Link to home
Start Free TrialLog in
Avatar of Erica8
Erica8

asked on

Switchboard for multiple users to access only their form for timecard data entry

I am using the Time and Billing template in MS Access.  I would like each of my employees to be able to access only his timecard with his individual password.  How do I create a switchboard for multiple users to access similar forms for timecard data entry?
ASKER CERTIFIED SOLUTION
Avatar of Emanon_Consulting
Emanon_Consulting

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Erica8
Erica8

ASKER

Thank you Emanon consulting!

I am not very familiar with Visual Basic code however I do have a basic understanding of programming code in general (C++).  I have a few questions.

1.  Do I paste your code into the global code window?

2.  When running the code, I get an error message in the line:   "If Not IsNull(Me.txtUserID) And Not IsNull(Me.txtPassword)"  The error message says "Invalid use of Me keyword".  How can that be fixed?

3.  When you suggested adding fields in the employee table, we added columns in the employee table labling them "EmployeeUserID" and "EmployeePassword".  Is this the correct way to add fields?

I really appreciate any help that you can give me!!
Hi Erica8,

I will first of all apologize if I am slow in responding.  I have just taken on a contract in a government building in our town for the next month or so and it is stricly forbidden for me to access my personal emails while in their building.  So I can only check my emails when I return to my home office.

Quick and Dirty explanation:
A "Private Sub" procedure is VBA code that resides 'behind' the Object (Form or Report) and is only available to that object, in this case your form.
A "Public Function" is VBA code that resides in a 'Module' and can be called from multiple objects (Forms or Reports).

1. Not global code. The sample code I provided would be placed behind the login form. Create a command button, in my code sample I called it "cmdLogon" and the code would fire on an "On Click" event procedure.
"Private Sub cmdLogon_Click()"

2. You need to create two text boxes on the Logon form. Call one "txtUserID" adn the other "txtPassword".
You may still need to taylor the code to meet your own needs.
You should be able to reference the fields on the Logon form like this... (either should work, just two paths to the same place)
Me.txtUserID    'Where "Me" is the current object and "txtUserID" is name of the text box
or like this...
Form_frmUserLogon.txtUserID   'Where you indicate the object is a Form and then give the name of the form "frmUserLogon" and "txtUserID" is name of the text box

3. In the Employee table you would likely have an EmployeeID field/column formatted as an autonumber field?? This would be the Primary Key.
To clarify, the EmployeeUserID and EmployeePassword fields would be something like "Erica8" (UserID) and "******" (Password). I believe we are on the same page with this one.

I hope this helps a bit. I have to run out to a clients for a few hours and will check my email when I get back.
Good Luck!
Cheers
M
Hi Erica8,

I was just wondering how you were making out with this?
Did you get it figured out or are you still needing some help?

Cheers
Michael