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!

Record 59 it is shown in first row

Status
Not open for further replies.

mi1306

Technical User
Jul 14, 2004
44
0
0
BG
Hi,

At me has arisen such problems:
I work with Access database. In the form I have DataGrid connected with Query in DB and I use DataEnvironment.
In DB everything is all right, but in DBGrid record with ID 59 shows on the first place and all is confused.
Obviously it and in Recordset.
Who that has idea what to occur?

Miho

 
Presumably you are populating your data grid from a recordset and that recordset is generated from some SQL. You should note that, without an ORDER BY clause, SQL does not guarantee any particular ordering for the returned records. Build an ORDER BY clause for the fields that you want and your record 59 should return to its proper place.
 
I do not work with SQL. Where to put ORDER BY clause?

Miho
 
mi1306

Trust me. If you're working with Access then you're working with SQL.

The "Query in DB" to which you refer is written in SQL. Go to "Queries" in Access; find the one that is being used to populate your datagrid and open it in design view. Each field that is in the query appears in the design grid. In the "Sort" box below each field that you want sorted, select "ASC" or "DESC" for ascending oe descending sort order and then save the query.
 
Thank ALL

Very much have helped me.

MIHO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top