Thank's Joan,
But more question:
After implement user level security wizard,Why does
my user cannot open/run the query in the database?
If you've implemented user level security, you can use the CurrentUser()
function to grab their Access username. I would make the button invisible
rather than disabled.
If CurrentUser() = 'shiro' then
Me.cmdWhatever.Visible = False
Else
Me.cmdWhatever.Visible = True
End If
You can also do this based on the group rather than just the user. There's
code in the security FAQ you can use to determine if a user is a member of a
group.
http://support.microsoft.com/?id=207793
If you haven't used ULS, then you can grab the user's Windows login name and
act on that. You'll find the code to retrieve this at
http://www.mvps.org/access/api/api0008.htm