P
Paul
Hello,
I am trying to open a DAO recordset with a parameter query, but I am getting
the following error message:
"The Microsoft Jet database engine could not find the object '#Temporary
QueryDef#'. Make sure the object exists and that you spell its name and path
name correctly."
The following is my code where the error is generated in the last line of
the With block statement.
mstrSql = "PARAMETERS lngPrmCustId Long, lngPrmCompanyId Long; " & _
"SELECT lngCustId, lngCompanyId " & _
"FROM tblCustomer " & _
"WHERE lngCustId = [lngPrmCustId] AND " & _
"lngCompanyId <> [lngPrmCompanyId];"
Set mdb = CurrentDb()
Set mqdf = mdb.CreateQueryDef("", mstrSql)
With mqdf
.Parameters(0).Value = Me.txtCustomer
.Parameters(1).Value = Me.txtCompanyId
.SQL = mstrSql
Set mrs = .OpenRecordset(dbOpenTable)
End With
I am using Access 2003 SP 2 on Win XP SP 2. Any help would be appreciated.
Regards,
Paul
~ The views expressed here are mine and do not reflect the official opinion
of my employer or the organization through which the Internet was accessed.
I am trying to open a DAO recordset with a parameter query, but I am getting
the following error message:
"The Microsoft Jet database engine could not find the object '#Temporary
QueryDef#'. Make sure the object exists and that you spell its name and path
name correctly."
The following is my code where the error is generated in the last line of
the With block statement.
mstrSql = "PARAMETERS lngPrmCustId Long, lngPrmCompanyId Long; " & _
"SELECT lngCustId, lngCompanyId " & _
"FROM tblCustomer " & _
"WHERE lngCustId = [lngPrmCustId] AND " & _
"lngCompanyId <> [lngPrmCompanyId];"
Set mdb = CurrentDb()
Set mqdf = mdb.CreateQueryDef("", mstrSql)
With mqdf
.Parameters(0).Value = Me.txtCustomer
.Parameters(1).Value = Me.txtCompanyId
.SQL = mstrSql
Set mrs = .OpenRecordset(dbOpenTable)
End With
I am using Access 2003 SP 2 on Win XP SP 2. Any help would be appreciated.
Regards,
Paul
~ The views expressed here are mine and do not reflect the official opinion
of my employer or the organization through which the Internet was accessed.