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!

Query difficulties

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
I am using the following code to set up a recordset of a query. The query SQL is below. The problem is when I try to set a variable to the value of Field3 an error tells me InvLine is not in the collection. The first two fields,Field1 and Field2 are there. In the locals window when I run the code it indicates there are only 2 items in the collection, the first two fields. Can anyone see what I'm doing wrong with this code?

Set qdef2 = db.QueryDefs("qry2")
Set parm2 = qdef2.Parameters(0)
'Set parameter value
parm2 = strField1
'Execute QueryDef to produce a recordset of qry2 which
Set rsAII2 = qdef.OpenRecordset


SELECT TblInvDet.Field1, TblInvDet.Field2, TblInvDet.Field3
FROM TblInvDet
ORDER BY Val([TblInvDet.Field2]), TblInvDet.Field3;
 
InvLine is not in the collection ?

What's InvLine?

I don't see it mentioned in the code.

Can you post the code that's actually raising the error?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top