Full Version: Input Mask WildCard. Should be easy
UtterAccess Forums > Microsoft® Access > Access Forms
xxdcmast
I have a field in a table which uses a textbox as the data entry method. The field itself is set to currency. I would like to create an input mask that will let the users enter in any amount of numbers they wish but not any letters.
searched the help file but could not find anything useful. Im hoping one of you can can help.
Thanks
iandouglas
The input mask character 9 is defined as
igit or space (entry not required; plus and minus signs not allowed)
So try something like
99999999999999999999999999999999999999999999999.99
Has an input mask.
PS you can trim or extend the 9's before the dp if you want!
Best of Luck
Ian
Shane
You can set the format of the text box to currency (Select the text box control and set the format to currency). If the user enters a non currency value then they will get a error message.
hane
xxdcmast
I saw the 9's thing in the help file for input masks however if i set it as 999999999999999999999.99 and the user only enters 99.99 then it throws back an error.
TW what is DP?
fkegley
Here I would probably use code in the KeyDown event of the text box. You would need to have another control on the form it can be hidden for it to change focus to when the enter key is pressed.
This code seems to work for me:
If KeyCode >= 96 And KeyCode <= 105 Then
KeyCode = KeyCode - 48
End If
If (KeyCode >= 48 And KeyCode <= 57) Then
Me.Text0.Text = Me.Text0.Text & Chr(KeyCode)
Else
If KeyCode = Asc(vbCrLf) Then
Exit Sub
End If
End If
fkegley
DP is Decimal Point
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.