Hello,
If I have a Text Box & if I want that everytime someone types in a space
then to not put a Space in to just move the cursor one position to the right.
I am able to do this with VBA coding with the following:
Private Sub txtHourlyRate_KeyDown(KeyCode As Integer, Shift As Integer)
'*** If Space is hit doesnt put space just uses Right Arrow & moves right 1
If KeyCode = 32 Then KeyCode = 39
End Sub
But for the Form I am building I will have a lot of Text Boxes that I want
to do the same for. What I am looking for is help on how I can save time
instead of typing in all these KeyDown Events for each control. I know VBA
doesnt have control arrarys, so another Idea I thought of was in the
Properites, in the KeyDown Event to put a Function in, & then in the Function
change the Space to the Right Arrow.
But for the Proporties function how can I pass the "KeyCode" number so I
know what is being typed ? Can this even be done ? I hope I didnt confuse
anyone.
Any help would be greatly appreciated.
Thank you,
Jeff
Mark Phillipson - 05 Apr 2005 16:06 GMT
Hi,
One option may be to use the Form KeyDown Event. (Note you will need to set
the Key Preview form property to Yes)

Signature
HTH
Mark Phillipson
Free Add-Ins at; http://mphillipson.users.btopenworld.com/
> Hello,
>
[quoted text clipped - 27 lines]
> Thank you,
> Jeff