Is the database on a shared drive? Because you did not include this information, it can't be assumed that you don't have a single computer shared by employees.
If you are using a shared drive, I would recommend finding code that identifies the user's id name, and set up a table of of all the userids with an access code for 1) View Full Time Hours, 2) View Part Time Hours, 3) View Both. I have used code that is available free on the internet which identifies the user's id, called basRegistry.
In the form Open event, identify the user id name, search your ID Names table, or whatever you choose to name it, for the name and make the control or controls visible that apply to the user's access rights.
Last edited by JerryDal; 04-21-10 at 11:37.
Private Sub Form_Current()
If IsNull(Me.Amount_1.Value) Then
Me!Amount_1.Visible = False
Me!Amount_1.Visible = True
If IsNull(Me.Amount_2.Value) Then
Me!Amount_2.Visible = False
Me!Amount_2.Visible = True
If the fields I test for Null in my example do not allow Null values, replace IsNull(Field...) by Field... = 0.
A more universal solution would consist in using:
If Nz(IsNull(Me.Amount_1.Value), 0) = 0 Then
But it all depends on how the fields are designed in the table (Data type, allow Null or not, default value, etc.).
Redsky, I am not sure if this post went off of another track, but I have spent enough time on this to earn a submission. Your problem posed a question in my mind: "is there a way to secure Access information in a non-shared environment?" Common sense tells me "no". Anybody with a thumb drive can take the database home, or perhaps email it to themselves from work, and then get through the security measures at their leisure.
I have just built a small database with a "Main" form that displays a picklist of users names, and then prompts for a password. It is not at all secure, but it does show that you can restrict the user's view depending on the access rights. If you unhide all the hidden objects you can see the workings of the application.
The password for ADMIN1 is "snickers". Once you log on as ADMIN1, you can see all the employees' passwords. I am only presenting this as a way to answer what I thought was a question about database security. It has been tested briefly.
If I understood the problem correctly, Redsky, you can never be sure about hiding data from view in your standalone PC environment.