I got the code below which opens a msg box for each error that is thrown. How can I put all of these in one if statement and have the last bit (isNumeric) in the else if statement?
Err tracks the error and changes to 1 if an error is found.
txtDescription.SetFocus
If txtDescription.Text = "" Then
err = err + 1
MsgBox "Please fill in the Description box!"
End If
cbCategory.SetFocus
If cbCategory.Text = "" Then
err = err + 1
MsgBox "Please select a Category!"
End If
txtSize.SetFocus
If txtSize.Text = "" Then
err = err + 1
MsgBox "Please fill in the Size box!"
End If
txtQuantity.SetFocus
If txtQuantity.Text = "" Then
err = err + 1
MsgBox "Please fill in Quantity box!"
End If
If Not IsNumeric(Me.txtQuantity) Then
err = err + 1
MsgBox "Quantity can only contain numbers!", vbCritical, "Quantity"
End If