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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forcing the structure of a field 1

Status
Not open for further replies.

Terrier

IS-IT--Management
Jan 29, 2003
18
0
0
GB
I have a database that requires a staff number to be 8 characters long and the first character MUST be a letter and the rest are numbers.

I have set up an input mask like this: >A9999999;;_

If I try to enter two letters it will not let me but if I enter a number as the first character it lets me. Advice??
 
I think it's >L9999999 that you need upper case A means letter or number
 
No that made no difference.
 
It works fine for me. Are you sure you mask is correct (>L9999999). Is it attached to the text box control or the database field? I prefer the former. If you've clicked on the text box it's easy not to go to the beginning of the field so I always attach this code to any text box with an input mask
[/code]


'------------------------------------------------------------
' Position_at_Beginning
'
'------------------------------------------------------------
Function Position_at_Beginning()
On Error GoTo Position_at_Beginning_Err

SendKeys "{F2}", False


Position_at_Beginning_Exit:
Exit Function

Position_at_Beginning_Err:
MsgBox Err.Description, vbCritical, STRSYSTEM
Resume Position_at_Beginning_Exit

End Function
Code:
best of luck
 
It's sorted now, I had two masks set up one on the form and one on the table!!

Thanks for your help.

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top