Hiding Control based on user

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have searched all over this site, and many others looking for a code or a
way to hide object in a form based on a user-lever security. I have found
sites that show me how to hide an object in a form but not how to hide it
based on a password that a user types in. I don't want to block the whole
form completely, just hide certain elements. If someone could please help me
out I would really appreciate it.

Thanks!!
 
You would need an IF statement in your "open" code of your form. To test by
the user it would be something like...

If CurretnUser()="SMITHJOHN" Then
SomeField.visible = False
Else
SomeField.visible = True
End If



To look at their "group" is more complex as everyone belongs to more than
one group in most cases. You would have to create a public function called
IsInGroup() and use it like...

If IsInGroup(Users)=True Then...


You would need to perform a search for "IsInGroup" and you should find links
to that code. It has been written about many times.


Hope that helps,

Rick B
 
It looks like the details you need were sent to me in March 2004 by Joan
Wild. They are...




Use the last function in section 22 of
http://support.microsoft.com/?id=207793
faq_IsUserInGroup


In the open event of your form

If faq_IsUserInGroup("SomeGroup", CurrentUser()) then
me!SomeControl.visible = False
Else
me!SomeControl.visible = true
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top