Scanner entry form

I’m trying to develop a form to use for barcode scanner data entry, for inventory control. I have got the scanner to work properly, so that it behaves just like keyboard entry to whatever field has the focus. There are some things about the form that I’m not clear on, though.

  1. how can I get a certain text box to have the focus when the form loads?
  2. how can I get the carriage return to trigger my macro? (UPDATE SQL)
  3. how can I get another text box to hold a parameter for my macro, with a default value?

Text Box focus - see Page 27 of the Getting Started with Base guide: click here.

Carriage return trigger - This would require a Key Handler. Macro(s) to inspect keys pressed and react accordingly. See Open Office Macros Explained by Andrew Pitonyak chapter 10: click here. Also see this post for a key handler: clickhere.

Using a TextBox - you can read the value of the text box in a macro. See section 18.3.7 of the Pitonyak guide for further information.

Other documentation is available: click here

Page 27 of the Getting Started is about tab stop order. I tried making the field I want the 1st tab stop, but that doesn’t give it the focus when the form loads!

Am I missing something there?

Sorry about that. Beside tab turn on Automatic Control Focus, the second button to right of Activation Order.

If Automatic Control Focus is activated, the first form control will be selected when you open the document. If the button is not activated, the text will be selected after opening. The Tab Order that you have specified determines which is the first form control.

For the Text Box, on the same page of the key handler post there is a sample (PBTest.odb) containing code to write to a text box. Reading is a simple change (line 17 of the code):

From: oField.Text = answer
To : answer = oField.Text