I'm trying to use a query in a recordset and I'm getting errors. The query was created in Access using a SQL table. The query and table are in my current database. I get runtime error 3061 (expected 3 parameters) at line in red.
Public Sub UpdateLotsizes()
Dim curDatabase As Object
Dim rstQryLot As Recordset
Dim rstInvLoc As Recordset
Set curDatabase = CurrentDb
Set rstQryLot = curDatabase.OpenRecordset("QryLotsize3")
I tried putting using "DAO" as follows:
Public Sub UpdateLotsizes()
Dim curDatabase As DAO.Object
Dim rstQryLot As DAO.Recordset
Dim rstInvLoc As Recordset
Set curDatabase = CurrentDb
Set rstQryLot = curDatabase.OpenRecordset("QryLotsize3")
but then I get a compiler error "user defined type not defined". Do I need another add-in? Am I going about this all wrong?
I'm sure I have other errors in this code that some of you may notice. I'm trying to correct one error at a time.
Thanks in advance for your help.
Public Sub UpdateLotsizes()
Dim curDatabase As Object
Dim rstQryLot As Recordset
Dim rstInvLoc As Recordset
Set curDatabase = CurrentDb
Set rstQryLot = curDatabase.OpenRecordset("QryLotsize3")
I tried putting using "DAO" as follows:
Public Sub UpdateLotsizes()
Dim curDatabase As DAO.Object
Dim rstQryLot As DAO.Recordset
Dim rstInvLoc As Recordset
Set curDatabase = CurrentDb
Set rstQryLot = curDatabase.OpenRecordset("QryLotsize3")
but then I get a compiler error "user defined type not defined". Do I need another add-in? Am I going about this all wrong?
I'm sure I have other errors in this code that some of you may notice. I'm trying to correct one error at a time.
Thanks in advance for your help.