Hi,
I am trying to enter data in a text box but with these code it does not allow me to enter number '9'. What am I missing?
Please help!Please Login or Register to view this content.
Mashiul
Hi,
I am trying to enter data in a text box but with these code it does not allow me to enter number '9'. What am I missing?
Please help!Please Login or Register to view this content.
Mashiul
Hi mashiulalam,
a. Try KeyAscii <= vbKey9
b. Please note that vbKey may be incorrect. 'Option Explicit' at the top of each code module should help you if this is a problem.
It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
This option requires all variables to be declared and will give a compiler error for undeclared variables.Please Login or Register to view this content.
Lewis
LJMetzer,
KeyAscii <=vbKey9 worked.
Great to know about Option explicit.
Thanks a lot.
Regards,
Mashiul
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks