Private Sub Command22_Click()
' This section deals with grabbing the 3 calculations from qry_LiveOEE
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
'Open a dynaset-type Recordset using a saved query
Set rst = dbs.OpenRecordset("qry_LiveOEE", dbOpenDynaset)
rst.MoveFirst
numfg_posted = rst!SumOfqty_complete
numOEE = rst!OEE
numpp_lhr = rst!ACT_PPLHR
rst.Close
dbs.Close
Set rst = Nothing
Set dbs = Nothing
I get an error saying Too few parameters. Expected 4.
This query has 5 things in the criteria section (design view), so why is it saying I need 4 parameters?
The 5 things in the criteria section (all under different fields) are:
- input from a form
- input from a form
- Switch statement based on current time
- Date()
- Is Not Null