So I have seen the only numbers method and was trying to use it when I stumbled accidentally upon another way of going about it...
for those who don't know what I'm talking about...the onlynumbers is something like...
what worked for me was much more simple. All I did was use an if statement to see if the textbox had a number greater than 60 and any letter is coming up as true...
Granted, in my application the user is entering minutes of an hour, so there entry will never be greater than 60.
it looks like...
I'm basically looking for an answer as to why this works and what situations it wouldn't work in...
for those who don't know what I'm talking about...the onlynumbers is something like...
Code:
[B]Private Sub OnlyNumbers()[/B]
If TypeName(Me.ActiveControl) = "TextBox" Then
With Me.ActiveControl
If Not IsNumeric(.Value) And .Value <> vbNullString Then
MsgBox "Sorry, only numbers allowed"
.Value = vbNullString
End If
End With
End If
[B]End Sub
[/B]
what worked for me was much more simple. All I did was use an if statement to see if the textbox had a number greater than 60 and any letter is coming up as true...
Granted, in my application the user is entering minutes of an hour, so there entry will never be greater than 60.
it looks like...
Code:
If Me.tbStartMM > 60 Then
MsgBox ("Invalid Entry.")
End If
I'm basically looking for an answer as to why this works and what situations it wouldn't work in...