Ask Your Question

scanner entry form

asked 2016-07-15 05:00:33 +0200

jvglynnjr gravatar image

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?
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2016-07-15 15:59:57 +0200

Ratslinger gravatar image

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

edit flag offensive delete link more


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?

jvglynnjr gravatar imagejvglynnjr ( 2016-07-16 02:46:53 +0200 )edit

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.
Ratslinger gravatar imageRatslinger ( 2016-07-16 03:24:00 +0200 )edit

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

Ratslinger gravatar imageRatslinger ( 2016-07-16 04:17:56 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-07-15 05:00:33 +0200

Seen: 530 times

Last updated: Jul 15 '16