I have had a look at a few threads on this and the Access VBA forum (and the FAQ's), and can't really find an answer. I have a switchboard type form on which I want to disable some buttons (6 of them) for one group of users. Can anyone help with some code? I've tried variations on the following which I got from an old thread: (it doesn't do the trick). Thanks for any help that anyone can give me. I really hope some time soon I can return the favour!!
if checkadmin = true
'then the person is a membor, so run what ever you want
else
'the current user is not a membor of the admins group...
end if
Public Function checkAdmin() As Boolean
Dim grp As Group
Dim i As Integer
Dim Flag As Integer
Set grp = DBEngine.Workspaces(0).Groups("Admins"
Flag = 0
For i = 0 To grp.Users.count - 1
If CurrentUser = grp.Users(i).name Then
Flag = 1
End If
Next i
If Flag = 1 Then
checkAdmin = True
End If
End Function
if checkadmin = true
'then the person is a membor, so run what ever you want
else
'the current user is not a membor of the admins group...
end if
Public Function checkAdmin() As Boolean
Dim grp As Group
Dim i As Integer
Dim Flag As Integer
Set grp = DBEngine.Workspaces(0).Groups("Admins"
Flag = 0
For i = 0 To grp.Users.count - 1
If CurrentUser = grp.Users(i).name Then
Flag = 1
End If
Next i
If Flag = 1 Then
checkAdmin = True
End If
End Function