×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Cursor does not return to search box after selecting with barcode reader

Cursor does not return to search box after selecting with barcode reader

Cursor does not return to search box after selecting with barcode reader

(OP)
Blessings to all.
I have a search box that manually reads and insert items into a grid. After doing this, the setfocus is return to the search box.
But the cursor stays in the grid if thd item is found with a barcode reader.
What should I do in order to obtain the same result when searching manually?

RE: Cursor does not return to search box after selecting with barcode reader

It sounds like these are two different events.
So you may need to add code to set the focus specifically to that text box.
Something like

... some code to scan with a barcode scanner...
ThisForm.TextField.Setfocus()

Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCAP, CDCP, CDCS, CDCE, CTDC, CTIA, ATS, ATD

"I try to be nice, but sometimes my mouth doesn't cooperate."

RE: Cursor does not return to search box after selecting with barcode reader

The trick is to try to work out which events are fired when you use the barcode reader. I suspect they will include the InteractiveChange of the textbox within the grid column., but you could use the Event Tracking tool (from the Debugger's Tools menu) to check that.

Once you have identified a suitable event, that's where you would put the SetFocus.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Cursor does not return to search box after selecting with barcode reader

Well, it sounds like you already programmed for the manual entry case. Then look what's different using the barcode scanner. It usually just also sends in keystrokes, so is like manual user input, just faster.
Mike is right, that event tracking will tell you which events occur.

Chriss

RE: Cursor does not return to search box after selecting with barcode reader

I suspect that the barcode reader is an ActiveX control. If it is, I have had issues with some ActiveX controls not releasing the cursor (keeping the focus) even though I explicitly set the focus to a native VFP control such as a textbox. What I did was to add another ActiveX control that I knew would not "steal" the focus to the form, put it off screen (set property Left = -100), and then added code to its GotFocus event to send the focus to the control that I wanted. In the problem ActiveX (in your case the barcode control) add the code to send the focus to the off-screen ActiveX.

Greg

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close