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!

Input Mask & Cursor Placement for Data Entry

Status
Not open for further replies.

PaulaKate

Technical User
Mar 6, 2002
8
0
0
US
Hi,
I am trying to create an input mask to facilitate data entry. The field value begins with the literal "DID" and is immediately followed by manditory entry of 5 digits, then an optional decimal point, and lastly two more optional digits. For example DID00001, DID00002, DID00005, DID00005.1, and so on. Based upon the tutorials, I have came up the following mask:

"DID"!#####C99

What I would like to have happen is that when a user tabs into the field, that the cursor is placed immediately after the literal text, but I have been unsuccessful so far. I have tried moving the exclamation point to the very beginning of the mask string, as well as some other variations, to no avail.

I realize that I could change the field to a number and paste DID to the front, but I don't have any macro/vb skills, and also do not wish to incur a potential workload of having to update every form & relationship connected to it.

Any solutions, or am I trying to swim upstream? Thanks
 
try this in the on click event
Code:
Me.Text0.SelStart = 3
 
I opened the form in design view, opened the properties dialog box, selected the Event Tab and pasted the code to the On Click property. After saving the change, I went back in Form view, I clicked on the field. The following error message surfaced:

"Acquired Lands Files Scanning DB can't find the object 'ME'. If 'ME' is a new macro or macro group, make sure you hve saved it and that you have typed it's name correctly."

Do I need to place this code into a macro first and then call the macro?
 

Try to skip (eliminate) [tt]Me.[/tt] and make sure [tt]Text0[/tt] is actually the name of your field (which is probably not Text0)

Have fun.

---- Andy
 
what you did is paste it in the event tab
what you have to do is in the event tab click on the command button wit the 3 dots and the module will open and in the event

Code:
Private Sub Text0_Click()
End Sub


add
Code:
Private Sub Text0_Click()
Me.Text0.SelStart = 3

End Sub


 
Appreciate the clarification. Opened the event builder window and added to code as instructed. It is nice to see popup/assist boxes show up as this is an indicator to me that I am on the right path. Added the code and tested; it runs (yea).

Thank you both for the assist,
Paula
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top