Hello,
I have two combo boxes one of them displays a number of tanks and the other displays a number of raw_materials.
I want to make sure, if i picked a tank_1 and filled it with material_1
If the user tries to pick material_2 to fill the tank_1 while the tank_1 has an amount from material_1, a warning message pops up, says that "you must not add another material till the tank is empty!."
Can anyone help me please?
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
GetRawTank1()
GetRaw1()
End Sub
Private Sub GetRawTank1()
' CLEAR COMBOBOX
cbxrawtank1.Items.Clear()
' QUERY raw_tanks TABLE
SQL.RunQuery("SELECT tank_name FROM raw_tanks where tank_name = 'Raw_Tank_A'")
' IF RECORDS ARE FOUND, ADD THEM TO THE COMBOBOX
If SQL.RecordCount > 0 Then
For Each r As DataRow In SQL.SQLDS.Tables(0).Rows
cbxrawtank1.Items.Add(r("tank_name"))
Next
ElseIf SQL.Exception <> "" Then
MsgBox(SQL.Exception)
End If
End Sub
Private Sub GetRaw1()
' CLEAR COMBOBOX
cbxraw1.Items.Clear()
' QUERY raw_materials TABLE
SQL.RunQuery("SELECT material_name FROM raw_materials")
' IF RECORDS ARE FOUND, ADD THEM TO THE COMBOBOX
If SQL.RecordCount > 0 Then
For Each r As DataRow In SQL.SQLDS.Tables(0).Rows
cbxraw1.Items.Add(r("material_name"))
Next
ElseIf SQL.Exception <> "" Then
MsgBox(SQL.Exception)
End If
End Sub