Password Protected

mugman17

Registered User.
Local time
Today, 14:50
Joined
Nov 17, 2000
Messages
110
I would like to password protect records on the form that have already been entered, not new ones. Essentially, if someone changes the company name on an older record, I would like to have a Msgbox pop up. But only on completed records.
 
mugman17,

Under the data tab for form properties set the form for allow edits = no and allow additions = yes. Then on the fields 'on Got Focus' event you could have a message box pop up and ask for the password. If the password is valid then:

Me.AllowEdits = True
Me.Refresh
MsgBox "Record Editing Enabled", vbExclamation, "Edit Mode"

This will allow the record to be edited. In addition, on the forms 'On Current' event you will need to disable editing by putting in this code:

Me.Allowedits = False

This way the form will not allow editing to old records but should still allow you to add additional records unless the correct password is entered. Another way you could set this up would be to have an "Allowing Editing" button on the form that asks for a password instead of each field unless you only have a few fields on your form. The button could really make this process easier from the standpoint of having to protect every field. If you need more help post back.

HTH,
Kevin
 
I have added a command button to the form that enables editing on saved deals.

With new deals I can enter everything, but when I get to the Save and Print button, I get a "Save Record isn't available". I have to click the Edit Record button before I can save the deal, anyway around this?
 
Jeff,

Try setting the allow edits field to yes in the data tab on the form properties box for starters.

What version of Access are you running? That might have something to do with it.

Another way around this might be to enable editing on the save and print button before it actually saves and prints. Maybe something like this:

Me.allowedits = True
'Do the save
'Print the record
end sub

HTH,
Kevin
 

Users who are viewing this thread

Back
Top Bottom