Item not found in this collection

jensonchandy

Registered User.
Local time
Today, 12:19
Joined
Jan 5, 2005
Messages
23
Runtime error 3265
Item not found in this collection


This error i'm getting when i'm running a report in ms access

And the code is like below

Public Function WhatSQL()
Dim ftext As String
Dim myqry As QueryDef
Set myqry = CurrentDb.QueryDefs(MQRY)
WhatSQL = myqry.SQL
End Function

regards
jenson
 
Set myqry = CurrentDb.QueryDefs(MQRY)

I think you have to put the query name in quotes ;

Set myqry = CurrentDb.QueryDefs("MQRY")

Hope that helps,
StepOne
 

Users who are viewing this thread

Back
Top Bottom