Some code to play with:
Code:
Private Sub cmdValidate_Click()
Dim tb1Val 'text box 1 value
Dim tb2Val 'text box 2 value
Dim tb1Good As Boolean
Dim tb2Good As Boolean
tb1Val = tb1.Value
tb2Val = tb2.Value
If IsNumeric(tb1Val) Then
If tb1Val <= 0 Then
'not okay
Else
tb1Good = True
Exit Sub
End If
End If
If IsNumeric(tb2Val) Then
If tb2Val <= 0 Then
'not okay
Else
tb2Good = True
Exit Sub
End If
End If
If tb1Good = False And tb2Good = False Then
tb1.BorderStyle = fmBorderStyleSingle
tb1.BorderColor = vbRed
End If
End Sub
TB1 is the name of the first text box, TB2 is the second...