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

How to return to active row in Grid?

Status
Not open for further replies.

Millard

Programmer
Feb 22, 2001
17
0
0
US
How can I return to the same active row in my grid after printing?
The record pointer goes back to row 1 in the grid instead of the current row.

I set a variable for the current row, i.e.,
Thisrow = Recno()
...printing current row
MYGRID.SETFOCUS()
MYGRID.ActivateCell(thisrow,1)

The record pointer goes back to the 1st row of the grid
instead of the current row. What's wrong?

Millard

 
Hi, i think this works
Thisrow = Recno()
...printing current row
Go ThisRow
MYGRID.SETFOCUS()
Jimmy Le
nhan_tiags@yahoo.com
 
Thisrow = Recno()
...printing current row
go Thisrow
MYGRID.ActivateCell(thisrow,1)
MYGRID.SETFOCUS()

Attitude is Everything
 
Grid returns to the current row, then pops back to the
first row in the grid. Still can't get the cursor to
remain in current on after return from printing..

Millard
 
what are you printing? the record of the row cursor is on? Attitude is Everything
 
Sounds like you may have some code in the activate event of the form that changes the position of the pointer.
 
TO MCTCO

You are correct. I do have code in the activate event which
requery a combo box on the form and calls a method which then retrieves data for the grid based on the first name in the combox. However, after making a selection from the combo box and printing a selected row in the grid, the cursor returns to the 1st row in the grid instead of the current row. Does the activate event fires again after the printing occurs?
If so, then this would obviously be the problem.

Any suggestions on work arounds?

Thanks
Millard
 
I have succesfully used

ActivateCell
then refresh

if this is not working I suggest you use the debugger to trace each line. as you trac check the program display. Attitude is Everything
 
the init event fires only once during the life of the form. The activate fires each time the for recieves the focus (like after a print window or messagebox).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top