S
Stalin
I have the following code looking up a record count, I am receiving
the 3601 error code on open.
Can anyone see what I might be doing wrong with this? I have enclosed
all parameters in brackets.
Another pair of eyes is requested.
Thanks in advance -
/***********
Private Sub Form_LOAD()
Dim db As Database
Dim rs As Recordset
Dim strSql As String
Dim p1 As String
Dim p2 As String
p1 = [Forms]![tabbed]![EMP2].Form![DEPT_CODE]
p2 = [Forms]![tabbed]![EMP2].Form![EMP_ID]
strSql = "SELECT * FROM SOP WHERE SOP.STATUS = ""ACTIVE"" AND SOP." &
p1 & " = True AND SOP.SOP_ID Not In (SELECT SOP_ID FROM EMP_SOP WHERE
EMP_SOP.EMP_ID = " & p2 & ")"
Set db = CurrentDb()
Set rs = db.OpenRecordset(strSql)
End Sub
***********/
the 3601 error code on open.
Can anyone see what I might be doing wrong with this? I have enclosed
all parameters in brackets.
Another pair of eyes is requested.
Thanks in advance -
/***********
Private Sub Form_LOAD()
Dim db As Database
Dim rs As Recordset
Dim strSql As String
Dim p1 As String
Dim p2 As String
p1 = [Forms]![tabbed]![EMP2].Form![DEPT_CODE]
p2 = [Forms]![tabbed]![EMP2].Form![EMP_ID]
strSql = "SELECT * FROM SOP WHERE SOP.STATUS = ""ACTIVE"" AND SOP." &
p1 & " = True AND SOP.SOP_ID Not In (SELECT SOP_ID FROM EMP_SOP WHERE
EMP_SOP.EMP_ID = " & p2 & ")"
Set db = CurrentDb()
Set rs = db.OpenRecordset(strSql)
End Sub
***********/