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?
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 ThenElse Msgbox "You are not allowed to change this field.",vbOKOnly Me.Thisfieldname.Undo Cancel = True Exit SubEnd If
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.
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.