G
Guest
Hi,
I got help earlier, but I got an error neither of us undersood
The error is:
Run-time error: '3061'
too few parameters. Expected 5
My Code looks like this:
Private Sub Additive_Click()
Dim rst As Recordset
Dim strSQL As String
Dim strAdditive As String
strAdditive = "Me!Additive"
strSQL = "SELECT * FROM [tblPropellant Query]" & " WHERE AD1NAM = '" &
strAdditive _
& "' Or AD2NAM = '" & strAdditive & "' Or AD3NAM = '" & strAdditive & "'
Or AD4NAM = '" _
& strAdditive & "' Or AD5NAM = '" & strAdditive & "';"
Set rst = CurrentDb.OpenRecordSet(strSQL)
If rst.RecordCount = 0 Then
'No Matches
Else
rst.MoveLast
rst.MoveFirst
End If
End Sub
and this part is highlighted:
Set rst = CurrentDb.OpenRecordSet(strSQL)
I would apreciate any help.
-James
I got help earlier, but I got an error neither of us undersood
The error is:
Run-time error: '3061'
too few parameters. Expected 5
My Code looks like this:
Private Sub Additive_Click()
Dim rst As Recordset
Dim strSQL As String
Dim strAdditive As String
strAdditive = "Me!Additive"
strSQL = "SELECT * FROM [tblPropellant Query]" & " WHERE AD1NAM = '" &
strAdditive _
& "' Or AD2NAM = '" & strAdditive & "' Or AD3NAM = '" & strAdditive & "'
Or AD4NAM = '" _
& strAdditive & "' Or AD5NAM = '" & strAdditive & "';"
Set rst = CurrentDb.OpenRecordSet(strSQL)
If rst.RecordCount = 0 Then
'No Matches
Else
rst.MoveLast
rst.MoveFirst
End If
End Sub
and this part is highlighted:
Set rst = CurrentDb.OpenRecordSet(strSQL)
I would apreciate any help.
-James