I am trying to create a routine that I can call into any textbox_change event, but my code isn't working. I will be calling this routine on 12 text boxes that sit within 12 different frames....anyone see why this isn't working?
Private Sub test()
With Me.ActiveControl
If Not IsNumeric(.Value) And .Value <> vbNullString Then
MsgBox "Sorry, only numbers allowed"
.Value = vbNullString
End If
End With
End Sub
Private Sub test()
With Me.ActiveControl
If Not IsNumeric(.Value) And .Value <> vbNullString Then
MsgBox "Sorry, only numbers allowed"
.Value = vbNullString
End If
End With
End Sub