Disable field using keyboard???

Hi unclejoe,

Yes, i did try ur sugguestion without using the code from missingling but still no value reflected in the field.
 
I do not know how you design your database and forms for the scanner.

I would suggest a “hidden” textbox. Don’t touch or set the control properties Visible just leave to “Yes”. Set the control’s “Back Color”, “Border Color”, “Fore Color” to the same color as the form’s background color. So that it looks invisible. You can reduce the size until you can’t see the cursor.

The rest of the visible textbox properties, set it to Enable = Yes and Locked = Yes and Tab Stop = No.

However, you still can use the mouse to set the focus. To prevent that, use the visible textbox “On Mouse Down” and “Double Click” event to trap and set focus the the “hidden” textbox so that you can use the scanner with the event to fill the visible textboxes. Use the OnCurrent event to set focus for the “hidden” textbox. The “hidden” AfterUpdate event will give an idea on how to fill the visible textboxes.

As I do not have the Scanner with me, I had to use the “hidden” textbox to manually input data and use the AfterUpdate Event for this test. You can try it out without the scanner too. Just make sure the “hidden” textbox is always in focus when you use the scanner.

Please refer to the “Table1” for more details of sample data.

Refer to the attached database sample.

Hope the sample will help you.

Hi unclejoe,
Yes, i did try ur sugguestion without using the code from missingling but still no value reflected in the field.
 

Attachments

I think Boblarson's comment is right on target; you need to first, before doing anything else, insure that the scanner is working correctly! I'd use the Form's Wizard to quickly run up a test form, then try to scan in data with the scanner, and see if that works.
 
99% of scanners feed into the keyboard buffer, and require little or no driver software. Some can be configured to append a tab or a CR to the code. So essentially, Access just sees keyboard input. I think uncle joe's approach is likely to work (though I haven't tested it out, not having a scanner to hand).
 
Hi There,

Can't you store the scanned value in a variable then assign it to the field which will work with locked controls.

Sorry never played with a scanner before but a friends got one I'm gonna play with.

You could also look for an SDK from one of the scanner manufacturer's.

Hope it help

mick
 
That’s right Neil, all Wedge/USB Type emulates keyboard action, the only exception is Serial Type where it uses supplied or customed software to input data into the form’s control.

I have never seen any customed Serial Type that will work with Access yet. It is usually activated by openning a Locked Down Form and the OnLoad or OnOpen event will run the customized software where it will disable the keyboard temporary or except one key or use the mouse to exit this form, so that you can use the scanner as the input.

They’re those who use ActiveX too.

The sample I gave will work with a scanner, workable to some degree for the OP. When you scan barcodes, the scanner will convert it into string or number, which will be visible to the user or readable to Access. If the hidden textbox is unable to clear old data, add a last line like “Me.Text0 = “””.

I did not include the sample Report with BarCodes for the OP, as there wasn’t any indication of the type and will cause an error when the user opens the report.

99% of scanners feed into the keyboard buffer, and require little or no driver software. Some can be configured to append a tab or a CR to the code. So essentially, Access just sees keyboard input. I think uncle joe's approach is likely to work (though I haven't tested it out, not having a scanner to hand).
 
How about this? Simply don't allow the textbox to ever keep focus?

Code:
Private Sub BarCodeTextBox_Enter()
  AnyOtherTextBox.SetFocus
End Sub

If it can't hold focus, the user can't enter data into it. Since you're not physically keying into/clicking on the box before the scanned value is read into the control, this might work. Worth a try anyway.

I was in WalMart yesterday and this problem popped up in my mind! One of my items wouldn't scan and the cashier had to enter the barcode by hand! Barcodes won't always scan. Assuming you attain your stated goal, how are you going to allow for the entering of barcodes if they won't scan?
 
Just to throw my 2 cents in.
I would suggest setting the text box to Enabled = Yes, Locked = Yes,
Have a command button next to it to enter the bar code,
have the command button pull up a small unbound form (Pop Up = Yes, Modal = Yes , a couple of command buttons to accept or cancel),
Use this form to recieve the bar code, then transfer the code to your original form.
 

Users who are viewing this thread

Back
Top Bottom