Luigi
Instead of using the user name only add a UserGroup field to the Users table. Then you just have to do a DLookup() on the user to get his group. That should limit you to just a few choices. Like if your groups are Manager, employee you could code if user group is 'Manager' then subform2 is visible.
Capeesh?
I do it that way in all my applications. Groups are much easier to manage.
Regards, Bill Mosca, Founder - MS_Access_Professionals http://www.thatlldoit.com Microsoft Office Access MVP https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-64270730881E My nothing-to-do-with-Access blog http://wrmosca.wordpress.com
--- In MS_Access_Professionals@yahoogroups.com, <ms_access_professionals@yahoogroups.com> wrote:
Hi all, I would like to submit this question, I suppose can be useful to many...
I've a 2003 mdb where I would like to give access to some subfoms depending on the network access name..
so let me define to let u understand:
MAINFORM --> contains subform_1 and subform_2
I log network access using =fOSUserName() and I collect all them (where they browse, how long etc)
Subform_1 is show to everybody
Subform_2 only to somebody
Subform_2 is set as hide
on MainForm load vba is:
If ([fOSUserName]) = "USER_1" Or [fOSUserName] = "USER_2" Then Form.[Subform_2].Visible = True Else Form.[Subform_2].Visible = False
OK, it works like a clock :-)
Now I've these user_1,2,3,4,5... in a table, or better in a query where I can set users allowed to see Subform_2...
How can I code the procedure and loop to read the user name and avoid to write down all users who can see the Subform_2?
Loop is one of my main problem!
Thanks to the holy people who help access no-skilled people like me... :-)
have a nice evening
Luigi
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar