S
shaggles
I'm getting an error message that says 'Too few
parameters. Expected 2' when I run the following code. It
seems to be the first SQL statement that's causing the
problem but I can't figure out what is wrong with it.
On Error GoTo Err_Command23_Click
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
If IsNull(Me!Group) Then
Set rst = db.OpenRecordset("SELECT * FROM tblResponse
INNER JOIN tblUsers " & _
"ON tblResponse.DeptID=tblUsers.DeptID " & _
"WHERE tblResponse.Issue_Num = " & Me!Issue_Num & ";")
Else
Set rst = db.OpenRecordset("SELECT
tblNotices.Issue_Num, tblUsers.Email " & _
"FROM (tblNotices INNER JOIN tblGroups ON
tblNotices.Group = tblGroups.GroupID) " & _
"INNER JOIN tblUsers ON tblGroups.UserID =
tblusers.UserID " & _
"WHERE ((tblNotices.Issue_Num = " & Me!Issue_Num & ")
AND (tblGroups.GroupID = " & Me!Group & "));")
End If
parameters. Expected 2' when I run the following code. It
seems to be the first SQL statement that's causing the
problem but I can't figure out what is wrong with it.
On Error GoTo Err_Command23_Click
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
If IsNull(Me!Group) Then
Set rst = db.OpenRecordset("SELECT * FROM tblResponse
INNER JOIN tblUsers " & _
"ON tblResponse.DeptID=tblUsers.DeptID " & _
"WHERE tblResponse.Issue_Num = " & Me!Issue_Num & ";")
Else
Set rst = db.OpenRecordset("SELECT
tblNotices.Issue_Num, tblUsers.Email " & _
"FROM (tblNotices INNER JOIN tblGroups ON
tblNotices.Group = tblGroups.GroupID) " & _
"INNER JOIN tblUsers ON tblGroups.UserID =
tblusers.UserID " & _
"WHERE ((tblNotices.Issue_Num = " & Me!Issue_Num & ")
AND (tblGroups.GroupID = " & Me!Group & "));")
End If