I have some code to check if an unbound text box contains a value or not.
I am checking if it does by using a numeric expression: If all the text boxes contain text, then i can run my code (as the message box "runcode").
To me this seems logical, but it wont work!
I am checking if it does by using a numeric expression: If all the text boxes contain text, then i can run my code (as the message box "runcode").
To me this seems logical, but it wont work!
Code:
Private Sub Command28_Click()
Dim test1 As Integer
Dim test2 As Integer
Dim test3 As Integer
Dim total As Integer
If Me.Form.box1 = "" Then
test1 = 0
Else
test1 = 1
End If
If Me.Form.box2 = "" Then
test2 = 0
Else
test2 = 1
If Me.Form.box3 = "" Then
test3 = 0
Else
test3 = 1
total = test1 + test2 + test3
If total = 3 Then
MsgBox "Runcode"
Else
MsgBox "A box contains no value!"
End Sub