Originally Posted by
ismith
Hello,
Im creating a form in Access 2010.
Ive made some text boxes and 1 combo box.
Im trying to validate them using If statement. If i do them all in seperate If statements it works but I want them to validate in 1 if statement.
If there any way its possible?
This is what im trying.
If Not IsNumeric(Me.txtQuantity) Then
MsgBox "Quantity can only contain numbers!", vbCritical, "Quantity"
Else If txtDescription.Text = "" Or cbCategory.Text = "" Or txtSize.Text = "" Or txtQuantity.Text = "" Or txtPrice.Text = "" Then
err = err + 1
MsgBox "Please fill in all the Fields!"
End If
Else ????????????????
End If
'err' is an error Int which im using to track the error and then using that to see if everything is validated to enter into database.
Thats the code. Its giving me an error saying 2nd statement should be on Line 1. But when i change it round it gives the same error.
Btw cbCategory stands for Combo box.
Can any1 help????
Thanks in advance..