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

Positioning at top of grid

Status
Not open for further replies.

AndrewMozley

Programmer
Oct 15, 2005
621
GB
I have a form which includes a grid grdsearch which lets the user select an account from a grid which displays information including name address and postcode; the grid displays about 10 rows.

A cursor Cursor1 is built up, with an index x1Curs which determines the order in which the records are to be displayed. This code runs:

Code:
SELECT Cursor1
SET ORDER TO TAG x1Curs
GO TOP
.grdSearch.RecordSource = "Cursor1"
.grdSearch.refresh()

The grid is indeed displayed, but it shows the last six records of cursor1, with blank lines at the bottom; no cell or row is highlighted. Only when I use the mouse am I able to position to the top of the grid.

I would like the first few records of Cursor1 to be displayed immediately, with perhaps the first row highlighted, so that the user can navigate with the keyboard or the mouse and then select an account.

How can I do that? I have tried .grdsearch.doscroll() and .grdsearch.activatecell(), without success. I feel that I must be missing something very obvious!

Thanks. Andrew

 
Thank you for your prompt replies. Yes, the Setfocus() does the trick. Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top