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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return to read-only when changing records

Status
Not open for further replies.

clickster

MIS
Feb 19, 2002
89
US
I have a form called fRMALookup that people will be using to browse/edit existing records. I have the form set to not allow edits by default. I also have a "Save Changes" button that will set Me.AllowEdits=False after saving the record so that they will go back to read-only mode after making their changes. Additionally, I have OnMouseWheel set to Me.AllowEdits=False so that, if they scroll to another record, it is read-only. My dilemma is that, if they use the navigation buttons at the bottom of the form to change records, it stays in "editable" mode. I don't want to remove the navigation buttons, but can't find a way to set Me.AllowEdits=False when they use them. I think I can use OnRecordExit, but can't figure out the syntax. The info is on MSDN and in Access Help, but I'm new to VBA, so the terminology is throwing me. Can anyone help me out on how to use OnRecordExit or with another way? The more specific and drawn-out the better since I'm new to VBA. Thank you in advance for any help.
 
Hi!

The on current event of the form fires whenever you move from one record to another, could that be used in your case?

Roy-Vidar
 
That's a good possibility. What else would trip that event?
 
From the help files (F1)

"The Current event occurs when the focus moves to a record, making it the current record, or when the form is refreshed or requeried"

So by what I read in your initial post, i got an impression it might fit.

Roy-Vidar
 
Perfect. That's exactly what I'm looking for. Thank you very much RoyVidar.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top