Hi,
I need to accept in my Textbox ONLY 5 Alphaphetic 4 numeric and 1 Alphaperic. So, Totally 10 characters only should accept. And there should not be any space..
How can i Set validation rule & show my own message for this...?
Any suggestion would be appreciated GREATLY.
Thanks in advance.
ngr.
6 3188
Hi,
I need to accept in my Textbox ONLY 5 Alphaphetic 4 numeric and 1 Alphaperic. So, Totally 10 characters only should accept. And there should not be any space..
How can i Set validation rule & show my own message for this...?
Any suggestion would be appreciated GREATLY.
Thanks in advance.
ngr.
Instead of a Validation Rule why not create an Input Mask? The following Input Mask will allow only 5 Alphas - 4 Numerics - 1 Alpha (no spaces): LLLLL0000L
Instead of a Validation Rule why not create an Input Mask? The following Input Mask will allow only 5 Alphas - 4 Numerics - 1 Alpha (no spaces): LLLLL0000L
============
Thnx...
Fine..But, I tried to show my own message instead of Access message in the message box as below ...But, its not working...
If Not IsNull([Vendor_TAN_No]) Then
If Vendor_TAN_No.InputMask <> "LLLLL0000L" Then
MsgBox "Eh..! The TAN Number must be 5 Alphapetic,4 Numeric, 1 Alphaphetic. Example : ABCDE1234A", vbOKOnly, "Vendor Creation"
Screen.PreviousControl.SetFocus
End If
End If
Can anybody suggest to me ....?
Your suggestion would be appreciated greatly.
Thanks in advance.
ngr.
============
Thnx...
Fine..But, I tried to show my own message instead of Access message in the message box as below ...But, its not working...
If Not IsNull([Vendor_TAN_No]) Then
If Vendor_TAN_No.InputMask <> "LLLLL0000L" Then
MsgBox "Eh..! The TAN Number must be 5 Alphapetic,4 Numeric, 1 Alphaphetic. Example : ABCDE1234A", vbOKOnly, "Vendor Creation"
Screen.PreviousControl.SetFocus
End If
End If
Can anybody suggest to me ....?
If Me!Vendor_TAN_No.InputMask <> "LLLLL0000L" Then
Your suggestion would be appreciated greatly.
Thanks in advance.
ngr.
Where exactly is the location of this code?
Where exactly is the location of this code?
-----
Its located in next controls of the gotfocus event..
Even, i tried with After_update of current control as below
If Not IsNull([Vendor_TAN_No]) Then
If Vendor_TAN_No.InputMask <> "LLLLL0000L" Then
MsgBox "Eh..! The TAN Number must be 5 Alphapetic,4 Numeric, 1 Alphaphetic. Example : ABCDE1234A", vbOKOnly, "Vendor Creation"
me!Vendor_TAN_No = null
Screen.PreviousControl.SetFocus
Endif
Your suggestion would be appreciated greatly.
Thanks in advance.
ngr.
If you want to alert the user before updating the control, place the code in the BeforeUpdate event...
-----
Its located in next controls of the gotfocus event..
Even, i tried with After_update of current control as below
If Not IsNull([Vendor_TAN_No]) Then
If Vendor_TAN_No.InputMask <> "LLLLL0000L" Then
MsgBox "Eh..! The TAN Number must be 5 Alphapetic,4 Numeric, 1 Alphaphetic. Example : ABCDE1234A", vbOKOnly, "Vendor Creation"
me!Vendor_TAN_No = null
Screen.PreviousControl.SetFocus
Endif
Your suggestion would be appreciated greatly.
Thanks in advance.
ngr.
Hi,
I need to accept in my Textbox ONLY 5 Alphaphetic 4 numeric and 1 Alphaperic. So, Totally 10 characters only should accept. And there should not be any space..
How can i Set validation rule & show my own message for this...?
Any suggestion would be appreciated GREATLY.
Thanks in advance.
ngr.
You must Trap the specifc Validation Error in the Form's Error() Event, display your own Custom Error Message, and tell Access not to display its own Error Message as in: - Private Sub Form_Error(DataErr As Integer, Response As Integer)
-
Const conValidationRuleViolation = 2279
-
Dim Msg As String
-
Msg = "Eh..! The TAN Number must be 5 Alphapetic,4 Numeric, 1 Alphaphetic. Example : ABCDE1234A"
-
-
Select Case DataErr
-
Case conValidationRuleViolation
-
MsgBox Msg, vbOKOnly, "Vendor Creation"
-
Response = acDataErrContinue
-
Case Else
-
MsgBox Err.Description, vbExclamation, "Error in Form"
-
End Select
-
End Sub
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Joey P |
last post by:
Hi all,
I am doing a project for university whereby i have to implement a
simple database related to a frozen foods company. I am having some
trouble though creating a validation rule for one...
|
by: Steve V |
last post by:
I'm using Access 2000 to build a budgeting/tracking database.
Can I make a validation rule (using VBA) that checks the data as if
the record has already been added?
I've got 5 tables (only the...
|
by: Boulent Mustafa |
last post by:
Using Microsoft Access 2000, I am defining a bunch of fields all with
default values.
The reason for this is that I have 5 text fields, each of which can
have 5 permutations depending on the...
|
by: GGerard |
last post by:
Hello
In a text box, I would like the user to be able to enter only a number from
0 to 100 (including decimals Ex: 24.56) so I wrote this in the Validation
Rule Propertie
of the text box : >=...
|
by: Chuck |
last post by:
A97. A database has a table: tblA which has a single text field, B. It is a
primary field, indexed and no duplicates. It is used as a lookup for table
tblC. A form based on tblA is used to add...
|
by: Michael R |
last post by:
I haven't found anything that would help me to understand the correct syntax for having a certain number of digits phone number validation rule.
My input mask for this field is: \000\-0000000;;...
|
by: voroojak |
last post by:
Hi
i just want the user can enter number not any thing else in form.
i tried >like "*#*"< in validation validation rule area and it seems that it is working and put just >accept number< in...
|
by: gweasel |
last post by:
What is the best way to apply a Validation Rule - or rather, where is
the best place to put it? Is there an advantage to putting it on the
field in the table vs setting the validation rule on the...
|
by: slenish |
last post by:
Hello all,
Im having some problems creating a validation rule with VBA. What I have is a form with a text box. When you start to type in the text box I want to have a validation rule set so you...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |