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

Sort Order

Status
Not open for further replies.

MadMax7

MIS
Feb 17, 2004
62
GB
I have the follwing code to fill in any blank records i have in field1


Set db = CurrentDb()
Set rst = db.openrecordset("tblInitialAgentCcsData", dbOpenDynaset)
rst.MoveFirst
Do While Not rst.EOF
strField1 = rst!Field1
rst.MoveNext
Do While IsNull(rst!Field1)
rst.edit
rst!Field1 = strField1
rst.Update
rst.MoveNext
Loop
Loop
rst.Close

what i need to be able to do is sort the table by Field241 could someonwe please help and let me know where i need to insert the sort by code

thanks


 
How about;

[tt]Set rst = db.openrecordset("Select * from tblInitialAgentCcsData ORDER BY Field241", dbOpenDynaset)[/tt]
 
Remou

thank you for your response i have updated my code and when it runs i am getting runtime error 3061 Too few parameters.Expected 1
 
Remou

i have sorted ut the issue above and it sorts fine however i am now getting a run time error saying record to large
and it selects

rst!Field1 = strField1

do you know what could be causing this?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top