Item not found in this collection

A

Alan T

I got this runtime error:
Item not found in this collection.

These are my code:
Private Function InitialiseNewInvoiceItems(InvoiceID As Long)
Dim invDB As Database
Dim qryInitialiseInvoiceItems As QueryDef
........
.......


Set invDB = DBEngine.Workspaces(0).Databases(0)
Set qryInitialiseInvoiceItems =
invDB.QueryDefs("qryInitialiseNewInvoiceItems") <----- error's here
....
....
End Function

I checked I have created a query has the same name
"qryInitialiseNewInvoiceItems".
Why it can't find it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top