Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keeping Form Fields Locked after exiting

Status
Not open for further replies.

Mike555

Technical User
Feb 21, 2003
1,200
US
I'm working with an Access Form and I want it to perform the following after a new record is added and the form is closed:

User.Enabled = False
User.Locked = True
PrintedFormat.Enabled = False
PrintedFormat.Locked = True

The form has a command button that the user clicks after they create a record. This command button saves the record and e-mails a report. If I add the above syntax into the command button's code, the fields are locked and disabled while the form is still open, but then if I exit and re-enter the record the fields are back to normal.

How could this be setup to occur?
 
You need to tell Access in the Current event of the form what you want it to do. Try moving the code to the current event of the form, and give it some instructions like:

If me.dataentry then

Do something

Else

Do another thing

End if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top