This is the code that's troubling me, under Access 97.
Private Sub DueDate_AfterUpdate()
Dim Comp, Batch, Ship, NYStd, NYMass, FillNumber
Dim strSQL As String
Dim rst As Recordset
Dim dbs As Database
strSQL = "SELECT * FROM tblStdPiecesperDay WHERE ProductType = Forms!frm1AddJob!frm1SubMassCode!ProductType;"
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(strSQL)
If rst.RecordCount = 0 Then
rst.AddNew
rst!ProductType = Forms!frm1AddJob!frm1SubMassCode!ProductType
rst!StdNumPiecesPerDay = InputBox("No data found related to how many pieces of " & rst!ProductType & " can be filled in a day.", "Inventory Database - no data found."
rst.Update
End If
FillNumber = rst!StdNumPiecesPerDay
rst.Close
Set rst = dbs.OpenRecordset("tblConfig"
Comp = rst!ComponentsNeededBy
Batch = rst!BatchStartedBy
Ship = rst!ShipDays
NYStd = rst!NYStdDays
NYMass = rst!NYMassDays
rst.Close
End Sub
I get the error message at
Set rst = dbs.openrecordset(strSQL).
The error message is : Run Time error 3061. Too Few parameters. Expected 1.
Does anyone know what's going wrong?
(yes, the form I am referring to to grab ProductType is open at the time the query is made. It's a subform of frm1AddJob, which is open.) Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum immane mittam.
Private Sub DueDate_AfterUpdate()
Dim Comp, Batch, Ship, NYStd, NYMass, FillNumber
Dim strSQL As String
Dim rst As Recordset
Dim dbs As Database
strSQL = "SELECT * FROM tblStdPiecesperDay WHERE ProductType = Forms!frm1AddJob!frm1SubMassCode!ProductType;"
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(strSQL)
If rst.RecordCount = 0 Then
rst.AddNew
rst!ProductType = Forms!frm1AddJob!frm1SubMassCode!ProductType
rst!StdNumPiecesPerDay = InputBox("No data found related to how many pieces of " & rst!ProductType & " can be filled in a day.", "Inventory Database - no data found."
rst.Update
End If
FillNumber = rst!StdNumPiecesPerDay
rst.Close
Set rst = dbs.OpenRecordset("tblConfig"
Comp = rst!ComponentsNeededBy
Batch = rst!BatchStartedBy
Ship = rst!ShipDays
NYStd = rst!NYStdDays
NYMass = rst!NYMassDays
rst.Close
End Sub
I get the error message at
Set rst = dbs.openrecordset(strSQL).
The error message is : Run Time error 3061. Too Few parameters. Expected 1.
Does anyone know what's going wrong?
(yes, the form I am referring to to grab ProductType is open at the time the query is made. It's a subform of frm1AddJob, which is open.) Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum immane mittam.