NauticalGent
Ignore List Poster Boy
- Local time
- Today, 18:54
- Joined
- Apr 27, 2015
- Messages
- 6,994
Hello all,
I am trying to do something neat with one of my forms and I am a little out of my league here (as usual)
I have a form with 4 tabs. What I want to do is set the Visible property to False for three of these if the user is not part of an office code.
To do this I used the following code on the Main Form's On Load Event:
TabControl(1).Visible = False
TabControl(2).Visible = False
TabControl(3).Visible = False
Works like a charm. However I want to make it conditional based on a user's Office Code: N41.
To accomplish this I made a function that reads the user's Computer Access Card to obtain the users name: ReturnUserName()
I have a table (tblUsers) that contains fields that store the user's name and Office Code: UserName & OfficeCode.
What I want to do is have the application check the office code assigned to the user and if it does not equal "N41" then TabControls 1-3 will not be visible.
I have tried to use DLookUp to do this but have not been able to make it work.
Any and all suggestions would be MUCH appreciated!
I am trying to do something neat with one of my forms and I am a little out of my league here (as usual)
I have a form with 4 tabs. What I want to do is set the Visible property to False for three of these if the user is not part of an office code.
To do this I used the following code on the Main Form's On Load Event:
TabControl(1).Visible = False
TabControl(2).Visible = False
TabControl(3).Visible = False
Works like a charm. However I want to make it conditional based on a user's Office Code: N41.
To accomplish this I made a function that reads the user's Computer Access Card to obtain the users name: ReturnUserName()
I have a table (tblUsers) that contains fields that store the user's name and Office Code: UserName & OfficeCode.
What I want to do is have the application check the office code assigned to the user and if it does not equal "N41" then TabControls 1-3 will not be visible.
I have tried to use DLookUp to do this but have not been able to make it work.
Any and all suggestions would be MUCH appreciated!