Automatic input mask..

D

dr

Hi all,
Have a good day.
I try to set an automatic inputmask on my form's text box.
I want to catch the last two digits of the year and two
digits of the month ( as number).

I tried:
Me.text0.inputmask = Format (Now,"yy - mm") & "-#####"

I want the user just input 5 numbers (replace #####),while the
yy-mm is automatically.

Ex : August 2008 will become 08 - 08 and if the user have data
102,the data will be 08 - 08 - 00102 .And the user just need to
type 102 only.

Would somebody like to help pointing me to the right direction.
Thank's
 
R

Ron2006

1) is that txtbox bound to a field in a table?

2) probably better to use date() instead of now() since now also
includes time - especially if this txtbox is bound.

3) I would probably suggest two separate unbound fields. load the
first part with following in oncurrent event of form
me.txt0 = format(right(year(date()),2),"00") & "-" & format
(month(date()),"00")
make sure that the tabstop property for this field is NO.

4) have the next part of the field in a separate txtbox with a format
if you want.

5) If you decide to really save the combined value as a field then
simply load that field with a value on the afterupdate event of either
of the two unbound txtboxes.


6) besure NOT to try to define the date related field as a date/time
format since that WILL REQUIRE a day in order to be saved.

7) formating in general becomes a bear to use since it is difficult to
get into the field. Tab sets the user on the field at the front and
using the mouse to go to a position will slow your input down. Any
other type of setting focus will probably make it a bear to update the
first part IF you are allowing it to be modified.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top