Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have secured my database with use

Status
Not open for further replies.

gyli84

MIS
Aug 6, 2001
67
GB
I have secured my database with user level security and staff are now required to logon to access it. What I need the helpdesk system I am creating to be able to do is:

1) To be able to display the Name (not their User ID) of the "currentuser" on a form by entering an expression in the control source or some other means (I have a "tblUsers" table whereby the UserID field is the same as the User Name for users logging into Access and the table also contains a "Name" field).

2) After logging in I need for either FORM1 to pop up if the person logging in is member of ADMIN or FORM2 to pop up if the person is only a USER.

3) For a combo box on a certain form to only be enabled if the currentuser is a member of Admin.

Also, does anyone know if it is possible and if so how to get an autonumber to start from 1 again. Just a small point but it is annoying as I am doing a calls database and would like to have my list of calls received starting from 1.

Thanks for all the help I've been given on these message boards!
 
Well, this is a lot of info. Basically this can be achieved by trapping the Currentuser info and matching this up with the records in your table - when a match is found, use the value of the Name field for that person in the tblUsers table. You will probably need to open a recordset based on the table, loop thru the records and test for a match each time, i.e.:

1) Open recordset
2) Movefirst
3) Is UserID field same as Currentuser?
4) If yes, set Name to value of Name field in recordset and exit loop
5) If no, move to next record.

For more specific help refer to help files in Access for Recordset, OpenRecordset, MoveNext subjects.

Re points 2 and 3 of your e-mail, this involves looping thru the user groups in the system and when you find the Currentuser, using the group returned to tell the app which window to open. Again, this is quite involved and help can be found by searching for "Group object" in Access help. If you select this option then choose "Group object (DAO)" in the dialog box youw ill get info on this and examples are good for showing how to add group accounts as well as find out to which group a user belongs.

Hope this helps. Have fun! :eek:)

Alex Middleton
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top