PDA

View Full Version : Inputmask on inputbox?



Ronald_yoh
02-09-2009, 05:30 PM
can I apply input mask to inputbox?

I need to apply date format (dd-mmm-yyyy) in inputbox. is this possible?

cheers
R

OBP
02-10-2009, 06:37 AM
I don't know of any way. Have you considered a normal Form or Pop-Up/Modal Form which would provide total control of the field for entering the data?

CreganTur
02-10-2009, 06:42 AM
InputBoxes do not have any native masking properties that I am aware of. Tony's suggestion of creating a custom form to serve as your input box is probably your best bet.

Just use a regular Textbox on your form and use the Password Input Mask- it's on the Data tab of the properties sheet.

CreganTur
02-10-2009, 07:37 AM
Okay, I did a little more digging and I was right- there is no native way to mask the input of an input box. The fastest and easiest way to accomplish what you want is with a form you can use in place of the InputBox.

However, it is possible to mask the input of an input box using API to hijack the keystrokes from the inputbox, load them into a variable, and force masked characters into the inputbox. You can see how to do this here (http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_20949769.html). However, you're using 200 lines of code to duplicate what a form could do with fewer system resources and no API calls.

Ronald_yoh
02-10-2009, 02:56 PM
hi All,

I know i can achieve it by creating another form but i was just trying my luck if there was a solution with inputbox.

by using inputbox i don't need to spend my time creating a form and code the textbox..

thanks for the confirmation.. will try the form then..

cheers
R