Avatar of jpb12345
jpb12345
 asked on

Microsoft Access forms and passwords

Ok i Have a access database where i have people inputting data into a form.  I locked 2 of the fields.  Only someone with a password can enter into those fields.  What I would like is if the user clicks in those fields then a password prompt comes up and they will be able to enter or change the data in those fields?  Can that be done?

thanks
DatabasesMicrosoft Access

Avatar of undefined
Last Comment
John Tsioumpris

8/22/2022 - Mon
SOLUTION
Scott McDaniel (EE MVE )

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
PatHartman

This prompting will eventually annoy the users.  Especially if you are going to do it once for each field.  A better design would be to have all users log on.  Assuming the login is valid, the login form hides itself rather than closing and opens the main menu.  Then in the BeforeUPdate event of EACH secured field, check the security level on the login form and either allow or deny the change.  Only one password entry will be required regardless of how many secured field on secured records will be updated.

If Forms!frmLogin!txtLevel > 7 Then
Else
    Msgbox "You are not allowed to change this field.",vbOKOnly
    Me.Thisfieldname.Undo
    Cancel = True
    Exit Sub
End If

Open in new window


This requires a little more sophistication than you are asking for but it will not annoy the users and it can be expanded.  To implement, create a table with a userID, password, and security level.  You will need a maintenance form that is only valid for users with a very high security level.
jpb12345

ASKER
Yeah this is  a small database that only one user will be entering data into these 2 fields (a few records a week).  I just want to keep them locked so the regular users don't put anything into these fields.  Realistically the special user can put data into the back end table for these fields.
SOLUTION
PatHartman

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
John Tsioumpris

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
PatHartman

I believe that was my first suggestion.
Your help has saved me hundreds of hours of internet surfing.
fblack61
John Tsioumpris

The difference is that i am not doing any checking...valid users have complete access and everything is visible...the others won't see anything
John Tsioumpris

the solutions provided cover all the cases