Doozer1979
Registered User.
- Local time
- Today, 17:41
- Joined
- Jul 4, 2007
- Messages
- 32
Hi Guys,
I need to validate text entered into a text box using VBA.
The text that will be entered needs to conform to the following criteria:
1. L[000], where [000] can be any number between 00 and 999
2. L[A][] where [A] can be be any letter of the alphabet, and [000] can be any number between 00 and 999
3. TD[000] where [000] can be any number between 00 and 999
4. AX[000] where [000] can be any number between 00 and 999
I'm assuming this would need to be placed in the OnExit or AfterUpdate events, but i'm having difficulty in getting even the most basic validation to work.
I'm using the following code just to test some basic validation, but i would like any errors to be displayed in a vbok message box.
If Me.txtCallSign.Value Like "L50" Then
Debug.Print "great"
Else: Debug.Print "error"
End If
Your help is greatly appreciated.
I need to validate text entered into a text box using VBA.
The text that will be entered needs to conform to the following criteria:
1. L[000], where [000] can be any number between 00 and 999
2. L[A][] where [A] can be be any letter of the alphabet, and [000] can be any number between 00 and 999
3. TD[000] where [000] can be any number between 00 and 999
4. AX[000] where [000] can be any number between 00 and 999
I'm assuming this would need to be placed in the OnExit or AfterUpdate events, but i'm having difficulty in getting even the most basic validation to work.
I'm using the following code just to test some basic validation, but i would like any errors to be displayed in a vbok message box.
If Me.txtCallSign.Value Like "L50" Then
Debug.Print "great"
Else: Debug.Print "error"
End If
Your help is greatly appreciated.