Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FIELD OR TEXTBOX VALIDATION HELP

Status
Not open for further replies.

HerickP

IS-IT--Management
May 10, 2000
68
US
Hi,<br><br>I have a table in access associated with a form that i use to enter data into the table. One textbox in my table is bounded to field &quot;PO Number&quot; and I have used this code to force data entry into the PO field:<br><br>Private Sub Form_AfterUpdate()<br>If Me![Text2] = &quot;&quot; Or IsNull(Me![Text2]) Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MsgBox &quot;Please key in The PO Number.&quot;, vbExclamation, &quot;Missing Info&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Me![Text2].SetFocus<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exit Sub<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br><br><br>This one works great, but now I just realized another problem: Users have been typing PO numbers with missing characters. The PO format has to be like this:<br><br>1234567ABCD = 7 numbers and 4 letters<br><br>How to force the textbox to validate and make sure this format is used, and also let the user know with some sort of a custom Msg box???? Thanks!!
 
on the textbox inputmask type in <br>000000LLLL this will require 7 numbers and 4 letters
 
Hello,
It may seems a very silly question to all of you but this question is driving me crazy. My question is that How can I set a text field that should only accept text (i.e. surname)nothing else. I have tried so many validation rules but it either accept everything (i.e. text, digit) or does not accept anything (i.e. text, digit, space etc)

Please please Help, it will be very kind of you

N M Ahmed
 
Dear N M Ahmed,

Please post your question on a separate thread as people assume that a question has been answered if it shows as having a reply and consequently may miss this one of yours.

HTH
Regards Jim
 
The format (or, input mask, actually) that forces entry in a text field to nothing except alphabetic characters is the character &quot;L&quot;. If you want to FORCE an exact number of characters, use the same number of &quot;L&quot;s :

LLLL <--- must inut FOUR characters.

If you want to have the option to enter less characters, use the ? character for each possible position, e.g. if it's a 10-character text field, use

?????????? ( 10 question-marks )






Ex-JimAtTheFAA
78.5% of all statistics are made up on the spot.
Another free Access forum:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top