Number AutoCorrect

  • Thread starter pushrodengine via AccessMonster.com
  • Start date
P

pushrodengine via AccessMonster.com

I need an Employee Number text box in the format “0000â€. The catch is, users
are supposed to enter “0345â€, but some will forget to enter the zero “345â€.
How can I get it so that if the zero is left out an expression will
automatically enter it?

Thanks
 
B

Bob Quintal

I need an Employee Number text box in the format “0000â€. The
catch is, users are supposed to enter “0345â€, but some will
forget to enter the zero “345â€. How can I get it so that if
the zero is left out an expression will automatically enter it?

Thanks

in the AfterUpdate event of the control, concatenate 4 zeroes and the
entered number, and grab the four rightmost characters.

me.EmNo = right("0000" & me.EmNo,4)
If me.EmNo = "0000" then
msgbox "You forgot to enter an Employee Number"
end if
 
F

fredg

I need an Employee Number text box in the format ´0000¡. The catch is, users
are supposed to enter ´0345¡, but some will forget to enter the zero ´345¡.
How can I get it so that if the zero is left out an expression will
automatically enter it?

Thanks

There are several ways. Here's one.
Code the control's AfterUpdate event:
Me.[ControlName] = Format([ControlName],"0000")
 
P

pushrodengine via AccessMonster.com

There are several ways. Here's one.
Code the control's AfterUpdate event:
Me.[ControlName] = Format([ControlName],"0000")

Works Great! Thanks
 

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