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

Run-time error 3265, item not found in this collection.

Status
Not open for further replies.

Himmer

Technical User
Feb 18, 2002
3
CA
Receiving the following error message, with a onclick event from an Access Form module. Below is the code, any thoughts suggestions or flames will be appericated.


Option Compare Database

Dim dbs As Database
Dim rstDocs As Recordset


Private Sub cmdGenerate_Click()
'On Error GoTo Err_Generate_Click

'declare some vars
Dim qdf As QueryDef
Dim intX As Integer
Dim strDate As String
Dim strTime As String
Dim strDoctorID As String
Dim strDoctorName As String
Dim strMsg As String
strDate = Me.txtsDate
strTime = Me.txtsTime
strDoctorID = Me.txtDoctorID

Set dbs = CurrentDb()
'dbs.OpenRecordset (qryDoctors)
Set qdf = dbs.QueryDefs(qryDoctors) ******* This where access chokes
qdf![DoctorID] = strDoctorID

Set rstDocs = qdf.OpenRecordset

Do while ..............
 
Hi,

The query name should be put in quotation marks, eg:

Set qdf = dbs.QueryDefs("qryDoctors")

as should the query name in quote marks on the line above, if you uncomment it.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top