G
Guest
Hi, everyone!
Have a query, "BOMWeights", that resides in the front-end database. It
brings together into one record summary data produced by 3 other queries that
extract data from a table in the back-end database. When I double-click on
the query, or use a OpenQuery command in VBA, it displays fine.
When I try to open it using the OpenRecordset command, however, it generates
a run-time error 3061: "Too few parameters. Expected 1." error. Here is the
code:
....
Dim rst1 As Recordset
Set rst1 = CurrentDb.OpenRecordset("BOMWeights")
With rst1
Me![PanelWeight] = Nz(![PanelWeight], 0)
Me![FrameWeight] = Nz(![FrameWeight], 0)
Me![HardwareWeight] = Nz(![HardwareWeight], 0)
End With
rst1.Close
Set rst1 = Nothing
....
What am I doing wrong?
Thanks,
Bruce
Have a query, "BOMWeights", that resides in the front-end database. It
brings together into one record summary data produced by 3 other queries that
extract data from a table in the back-end database. When I double-click on
the query, or use a OpenQuery command in VBA, it displays fine.
When I try to open it using the OpenRecordset command, however, it generates
a run-time error 3061: "Too few parameters. Expected 1." error. Here is the
code:
....
Dim rst1 As Recordset
Set rst1 = CurrentDb.OpenRecordset("BOMWeights")
With rst1
Me![PanelWeight] = Nz(![PanelWeight], 0)
Me![FrameWeight] = Nz(![FrameWeight], 0)
Me![HardwareWeight] = Nz(![HardwareWeight], 0)
End With
rst1.Close
Set rst1 = Nothing
....
What am I doing wrong?
Thanks,
Bruce