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

ADODB query in form

Status
Not open for further replies.

dbero

Technical User
Mar 31, 2005
109
US
I am trying to open an ADODB recordset in a form and order by two elements, but it won't let me. It will order by one element, but not both. Any suggestion on how to modify the SQL in the form to sort by ARP ID first, then begindate?

Dim OpenLegStatSeq As ADODB.Recordset
Set OpenLegStatSeq = New ADODB.Recordset
OpenLegStatSeq.Open "SELECT * from LegalStatSeq ORDER BY LegalStatSeq.[ARP ID], LegalStatSeq.begindate asc;", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
 
If you run your Select statement in Access:
[tt]
SELECT *
from LegalStatSeq
ORDER BY [ARP ID], begindate
[/tt]
Do you get the records in the right order?
Is the field [tt]begindate[/tt] defined as Date?

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top