I've been attempting to relate two recordsets in order to take advantage of the relational aspects of my database.

This wasn't terribly difficult in the end, & I've managed to create a recordset that I'm happy with. The problem is that I'd like to use the SQL ORDER BY function to order the recordset by [JOB NUMBER]. However, I'm finding it hard to get the correct syntax because of the other elements I've had to put into my query. Does anyone have a quick fix?

The code is below.

Thanks.

Sam

VB Code:
  1. ClientIndex = rec3ClientDetails("ID")
  2.  
  3.     str2Query = "SELECT * FROM [RECORDDETAILS] WHERE [CLIENT DETAILS] = " & ClientIndex
  4.    
  5.      Set rec3IndivRecords = dba3Database.OpenRecordset(str2Query, dbOpenDynaset)