View Full Version : VBA for Access2003
eteezy
02-08-2008, 07:57 AM
Hi I have been stuck on a Access project I have been working on. I have two issues. When the form is ready it will be used with a touch screen but I can't get my numeric keypad to enter the values in to the UOM (unit of measure field) without overwriting each other. The user should be able to enter a three digit value in the UOM field but they should not be able to enter a value of zero or a value greater than 128. Also I would like to code a clear button in case the user makes a mistake. Any help you could provide would be helpful. Thanks in advance.:banghead:
rconverse
02-08-2008, 08:54 AM
In order to clear a text box, you can just create a button that has the following VBA behind it:
Me.txtbox.value = ""
I would check the format and properties of the control that won't allow you to enter more than one digit at a time.
HTH
Roger
eteezy
02-08-2008, 07:39 PM
Thanks. I got the clear button to work but I'm still having trouble with the keypad.
Trevor
02-08-2008, 07:47 PM
try onclick of comand Name
Me.Text box = [Value]
or send keys "1"
next command on click
Send keys "2"
asingh
02-08-2008, 07:54 PM
attached is a db..have a look..!!
thanks and regards,
asingh
eteezy
02-08-2008, 08:04 PM
asingh,
That is great! That's exactly what I need the keypad to do! You guys are awesome! One question...what does the Call chk_val_ln do?
asingh
02-08-2008, 08:12 PM
Just a thought..what if someone enters data via the keyboard..then the keypad looses the constraints set...
Copy paste these lines below the cmd9_Click() module
Private Sub txtbox_ounce_KeyDown(KeyCode As Integer, Shift As Integer)
Form_frm_main.txtbox_ounce.Text = ""
End Sub
Private Sub txtbox_ounce_KeyPress(KeyAscii As Integer)
Form_frm_main.txtbox_ounce.Text = ""
End Sub
Private Sub txtbox_ounce_KeyUp(KeyCode As Integer, Shift As Integer)
Form_frm_main.txtbox_ounce.Text = ""
End Sub
regards,
asingh
eteezy
02-08-2008, 09:14 PM
asingh,
No worries. This is a touch screen application. There will not be a keyboard available. Good point though. :thumb
asingh
02-09-2008, 09:20 AM
asingh,
One question...what does the Call chk_val_ln do?
It checks the length of the data all ready present in the text box. If it all ready = 3, then no use taking anymore input via the buttons. And the click will fail...!
regards,
asingh
eteezy
02-10-2008, 05:45 PM
Thanks Asingh! I didn"t read the module. It made since after I looked at the module. Thanks a million, you make this stuff look easy. :beerchug:
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.