Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

VictorFRodriguez

Programmer
Jan 20, 2001
51
DO
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?
 
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.
 
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
 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top