I am trying to set a default value into a "bottles required" text box control based on the value of the fourth column of a combo box. I was able to do that successfully. However, there is another text control txtSpecialTests that will affect the number of bottles required. Basically, if there any special tests in the txtSpecialTests control, I want to add 1 to the value in column 4 of the combo box. If txtSpecial tests is empty or null, I don't want to add 1.
I have the following code in the AfterUpdate event of the combo box:
Private Sub cboSelectedGridID_AfterUpdate()
Select Case Me.txtSpecialTests
Case IsNull(Me.txtSpecialTests)
Me.txtBottlesRequired = Me.cboSelectedGridID.Column(3)
Case Me.txtSpecialTests = ""
Me.txtBottlesRequired = Me.cboSelectedGridID.Column(3)
Case Else
Me.txtBottlesRequired = Me.cboSelectedGridID.Column(3) + 1
End Select
End Sub
It adds 1 every time, no matter whether the txtSpecialTests control is empty, null or not.