G
Guest
Hi there!
I'm trying to make sure that when person enters something in the approval
field on my form, they are authorised to do so. I'm doing it this way
because Senior managers may change and I want future administrators to be
able to add or delete Senior Managers.
strUser ID is a field on my form and PubUserID is a public variable.
Private Sub strAppMgr_BeforeUpdate(Cancel As Integer)
strUserID = PubUserID
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("select * from tblSnrMgrs where strSnrMgrID="
& Me.strUserID, dbOpenSnapshot)
If rs.RecordCount = 0 Then
MsgBox "Sorry, you aren't entitled to approve projects", vbOKOnly,
"So Sorry"
End If
When I do this, I get a message saying too few parameters, expected 1.
What am I doing wrong? Thanks to everyone who replies!
John
I'm trying to make sure that when person enters something in the approval
field on my form, they are authorised to do so. I'm doing it this way
because Senior managers may change and I want future administrators to be
able to add or delete Senior Managers.
strUser ID is a field on my form and PubUserID is a public variable.
Private Sub strAppMgr_BeforeUpdate(Cancel As Integer)
strUserID = PubUserID
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("select * from tblSnrMgrs where strSnrMgrID="
& Me.strUserID, dbOpenSnapshot)
If rs.RecordCount = 0 Then
MsgBox "Sorry, you aren't entitled to approve projects", vbOKOnly,
"So Sorry"
End If
When I do this, I get a message saying too few parameters, expected 1.
What am I doing wrong? Thanks to everyone who replies!
John