Could somebody please help. I have written the following code
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("qryFindDuplicate")
If rst.RecordCount >= 1 Then
DoCmd.OpenQuery "qryUpdateMill"
Else
MsgBox "This data has already been input into the Mill Sheet", vbInformation, "Mill Sheet"
End If
rst.Close
Set db = Nothing
The trouble I am getting is that my Query 'qryFindDuplicate' has 2 parameters therefore each time I run this code I get an error message saying "Too few parameters.Expected 2."
Maybe I am going about this the wrong way or maybe it is something simple whatever it is I need some help from you knowledgeable people out there.
Thanks is advance
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("qryFindDuplicate")
If rst.RecordCount >= 1 Then
DoCmd.OpenQuery "qryUpdateMill"
Else
MsgBox "This data has already been input into the Mill Sheet", vbInformation, "Mill Sheet"
End If
rst.Close
Set db = Nothing
The trouble I am getting is that my Query 'qryFindDuplicate' has 2 parameters therefore each time I run this code I get an error message saying "Too few parameters.Expected 2."
Maybe I am going about this the wrong way or maybe it is something simple whatever it is I need some help from you knowledgeable people out there.
Thanks is advance