By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,027 Members | 1,271 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,027 IT Pros & Developers. It's quick & easy.

Password specific forms

P: 145
Hi ya again,

I don't see any real problem ,but has anyone attached a password to specific forms? I need a way to stop 'normal' users from 'doing something' to the data thru a form, and, frankly, the usual workgroup method is cumbersome at best (and doesn't work with individual forms, no?). it only has to be a 'padlock' ones going to go digging deeper to break it, but (I guess), I need to pause any code/events....ho, couldn't the password 'box be modal? that would stop any processes wouldn't it?

Sorry, thinking while asking. But you see what I'm after?

Stonward the Cuffuffled
Aug 10 '07 #1
Share this Question
Share on Google+
5 Replies

Expert 2.5K+
P: 3,532
Is this a split database? If so, why not simply have two different frontends. In the one for the "common folks" set all forms to read-only.

For the form goto Properties - Data and set AllowEdits, AllowAdditionsAllowDeletions and to No.

And you're correct, Access' native security is a mare's nest!

Linq ;0)>
Aug 10 '07 #2

P: 47
I agree with you that Access Workgroup security is very cumbersome and I don't use it. I had to solve a problem like yours in the past and what I did was to create two versions of the forms, one of which was read-only (set Allow Edits, Allow Additions and Allow Deletions all to 'No' in the Data tab of the form properties. Make this the default form and have a second copy with these set to Yes which is only accessible when the user enters a password.

(I'd suggest an Update button on the default form which would open a password dialog. Entering the correct password will open the updateable form, if an incorrect password is entered open a messagebox to this effect).

If you'd like to see the code let me know

Good luck!
Aug 10 '07 #3

P: 145
ha ha! Looks like I touched a raw one with Access security, eh?! In the last version of the DB I'm working on I remember spending a great deal of time going round and around learning how the 'security' worked.

The database is split: can you post your code for me Barry07? i'd be most grateful. I thought of the second frontend idea Linq, but just wonder about the complexities and performance issues? have you tried that idea in the past?

Thanks for all your hel, folks. Just knowing others are/have tackled the same problems is a real comfort as I'm sure you're aware!

Thanks again,

Stonward the Comforted
Aug 10 '07 #4

P: 47
Suppose you have a button lablelled UPDATE in the standard (read-only). form. The click-event for this button opens a password-input form ("frmPassword") which has one text box only. On the DATA tab of the properties for this text box set Input Mask to password so that the password is displayed as "******" as the user enters it.

The code for the click-event would read as follows

Expand|Select|Wrap|Line Numbers
  2. Private Sub cmdUpdate_Click()
  3. DoCmd.OpenForm "frmPassword"
  4. End Sub
The code in the password-input form will read
Expand|Select|Wrap|Line Numbers
  1. Sub txtPassword_AfterUpdate()
  2. If txtPassword = gPassString Then
  3.     DoCmd.OpenForm "MyEditableForm"
  4. Else
  5.     MsgBox "Incorrect password", 
  6. End If
  7. End Sub
In accordance with the Good Practice standards advocated by this group you should define the actual password as a global constant in a code module, so you only have to change it once:

Expand|Select|Wrap|Line Numbers
  1. Global const gPassString="mypassword"
Don't hard-code it in the form.
Aug 10 '07 #5

P: 145
Thanks Barry07!

Have a great day, people.


Aug 13 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.