sassy
New Member
- Joined
- Feb 23, 2009
- Messages
- 38
I have seven VB forms in my project with over a hunderd text boxes. i have the following code for one of my text boxes to not allow anything but numbers. I have two requests that I need some expert advise on...
1. here is my current code:
Q: i want to make this same logic for all my text boxes that should only have numbers. Is there any easier way to do this without writing this code for each box. I seriously have over hundred between all seven forms.
2. I also have a text box that I only want a date to be entered.
Q: is there a control that i am not finding that will only allow a certain format like mm/dd/yyyy??
Thanks, in advance!!!
1. here is my current code:
HTML:
Private Sub hLine801_Change()
If hLine801 = vbNullString Then Exit Sub
If Not IsNumeric(hLine801) Then
MsgBox "Sorry, numbers only"
hLine801 = vbNullString
End If
End Sub
Q: i want to make this same logic for all my text boxes that should only have numbers. Is there any easier way to do this without writing this code for each box. I seriously have over hundred between all seven forms.
2. I also have a text box that I only want a date to be entered.
Q: is there a control that i am not finding that will only allow a certain format like mm/dd/yyyy??
Thanks, in advance!!!