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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Grid.Activatecell

Status
Not open for further replies.

Shevshenko

Programmer
Mar 14, 2003
7
TN
Vfp 6.0 SP5 On Win98SE
I have a grid based on an alias in which I insert a number of rows (ie 100 products).The last grid's column is the serial number of the product which is not inserted with the insert instruction.So after that I put the mouse cursor on the last column of the first row and I begin scanning the SN of the first product with a Code Bar Scanner (connected to the PC by the PS/2 with the keyboard) which put the SN in the cellule and does a validation automatically.I put a code in the Valid event of the textbox of the column to make the mouse cursor go to the next SN column using GRID.ACTIVATECELL(activerow + 1 , activecolumn) and GRID.REFRESH().But it seems to not going right so the cursor is on the first column of the same row.
Any suggestions please.
 
Hi Shevshenko,

You cannot programmatically move focus in that way in the texbox's Valid. You have to do it in a different event.

Try moving your code to the textbox's Keypress event. Test to see if Enter or Tab has been pressed; if it has, execute GRID.ACTIVATECELL(activerow + 1 , activecolumn).

Let me know if it works.

Mike


Mike Lewis
Edinburgh, Scotland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top