Rich said:
Well, I am going to have the app start in full screen
mode. when the touch through the menu forms they will
eventually be needing to enter data. for example... One
thing that I am doing is making a employee time clock
system. SO the user can hit the time clock button to open
the form.. they will need to put in there ID PIN# so I
will need to add a button set on the form that will write
to the ID field and then I can validate it in the user
table via "OK or ENTER button"
I am assuming that I will have to just create buttons with
what I want, then on click set something upto add to the
end of the current field. oh, I guess I will need
something to clear back one space too in case they mess up.
other parts of the system will need alpha and Numerical
button entry on the form as well.. any help or a shove in
the right direction would be great.
Here's a rudimentary example of how you might set up such a thing. Have
a command button for each of the keys on the "keypad". For all the
normal letter and number keys, and the space bar, set the command
button's Tag property to the value of the key. So the Tag property of
cmdKeyA is A, the Tag property of cmdKey1 is 1, and the Tag property of
cmdKeySpace is a single blank space. For any special keys, such as the
back-space, set the Tag property to a code you pick; for example, {BS}.
Now set the OnClick property for all of these buttons to the same
function expression:
=TypeKey()
Define the TypeKey function in your form's Module. Here's a start at
such a function:
'----- start of example function -----
Private Function TypeKey()
Dim strKey As String
strKey = Me.ActiveControl.Tag
With Me.Text0
Select Case strKey
Case "{BS}"
.Value = Left(.Value, Len(.Value) - 1)
Case Else
.Value = .Value & strKey
End Select
End With
End Function
'----- end of example function -----
You would replace "Text0" with the name of the control to receive the
simulated keystrokes. Note that, since the receiving text box is
hard-coded, the keypad can only be used to enter data in one text box on
any given form. One could, if one wanted to, modify this so that the
text box to receive the keystrokes is set by some code or specified in a
variable or control, thus allowing greater flexibility. For the limited
purpose you described, though, the simple solution may be adequate.