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

Copy selection of previous control into input mask

Status
Not open for further replies.

njwcad

Technical User
Oct 16, 2002
156
GB
Can you please help

I have two controls on a form, sourced from an underlying table. Selection of the first control defines the input mask of a second control through a macro. However I would also like to autopopulate part of the second control from the first so it would go something like this

If first control = PDU1B then set input mask of second control to ">LLL0-L-00L" (this works fine) I would then like to do the following
If first control = PDU1B then second control
= "PDU1-B-00L", leaving the final part of the input mask to be completed by the user. If this is possible, maybe through the macro (although I'm not sure of the syntax) any advice would be appreciated

Njwcad
 
How are ya njwcad . . .

Mixing of input masks is sure to raise an error as [blue]the entire column of previously saved values takes on the new mask[/blue] . . . Sorry!

Calvin.gif
See Ya! . . . . . .
 
I've done a little bit of playing with this. I love a good challenge. The only way that I can see this happening would be to cut this field into two fields on your form. in the first field, set the default value to the portion of the previous field that you want repeated, then use the end of the input mask for the second portion of the field. in the AfterUpdate of the second field, reassemble the field.

This way, the user can either use the Tab key to jump to the second portion of this field, or key over it. If the two fields are positioned with no gap between them, and the left field is right justified, and the right field is left justified, it will appear as one field, with the Tab key or Enter key to get to the second half.

HTH,
Vic
 
njwcad . . .

Had to run out . . .

Your problem is [blue]maintaining the excellent validation attained by using an Input Mask[/blue]. Espcially when the mask will change!

I suggest a seperate unbound popup input form for this. Using the [blue]OpenArgs[/blue] arguement of the docmd.OpenForm method, you could send the mask and data to the form. In the popup you setup the mask & data. On closing the form a little logic to determine wether to enter the data in the calling form does the rest.

I see no other way as yet to maintain the validation you need!

Your thoughts? . . .




Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top