open a query as a recordset

  • Thread starter Thread starter Kurt Neumann
  • Start date Start date
K

Kurt Neumann

i'm self taught and use recordsets in access 2000 vba, usually without
problems, but i'm trying to use a query to define a recordset, and i keep
getting an inaccurate parameters error, needing 4!
here is the type codes i've tried:

Dim db As Database
Dim r As DAO.Recordset
Set db = CurrentDb
Set r = db.OpenRecordset("qu_approval", dbOpenDynaset, dbSeeChanges)


or

Dim db As Database
Dim r As DAO.Recordset
Dim qdf As DAO.QueryDef

Set db = CurrentDb
Set qdf = db.QueryDefs("qu_approval")
Set r = qdf.OpenRecordset

any help? thanks
 
What happens if you try this code in a new database? If it works there, I
would suspect something corrupted. Try a decompile or importing everything
into a new database. Also, make sure you have all of the Office 2000 patches
up to date (http://office.microsoft.com).
 
What happens when you run the query interactively? Do you get prompted for
values?
 
Back
Top