IF Statement in On Click Event

matthewnsarah07

Registered User.
Local time
Today, 07:17
Joined
Feb 19, 2008
Messages
192
I have a frmTM which most staff use to complete Health and Safety checks, however some staff have the responsibility to oversee otherr checks on frmLTM

I have a field called USER on frmTM - I want to add an iif type statement to a button so that if the contents of [USER] = "mccors" or "baylim" it will open frmLTM otherwise a MsgBox saying no access.

How would I right this statement

Thanks for you help
 
Howzit

Something like

Code:
Private Sub yourcommand_Click()

Dim strForm As String

Select Case Me.User
    Case Is = "mccors", "baylim"
        strForm = "frmLTM"
        docmd.openform strForm
    case else
        MsgBox "No access granted"
End Select
    
End Sub
 

Users who are viewing this thread

Back
Top Bottom