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!

Locking a Form 1

Status
Not open for further replies.

Mreid99

MIS
Apr 27, 1999
8
US
I'd like to be able to view a form without being able to change the data in that form. Then to make changes by clicking a button which would unlock the &quot;individual&quot; form and allow a minor change. Then if I went to another page in that form, I would have to click that unlock button to make a second change.<br>
<br>
Then prior to exiting access97, I'd like to see all of the changes I had made to the table in a report form. <br>
<br>
Any ideas would be greatly appreciated. Mark
 
Here's a couple of ideas. Turn the form's Allow Edits property off using the OnCurrent property. Use a button to turn it back on. Turn it back off with the OnClick of the button you use to navigate to the next page and/or the PageDown key Turn off vertical scroll).<br>
<br>
You could capture the login name and update the login time in tblLogin. Capture the login and time each time a record is updated. (If you want to see changes &quot;before&quot; as well as after you'd have to save the old data to a copy of the table that also has the login name and time. You'd probobly want to delete that user's changes when they exit or log in, or zap the table as part of your routine daily/weekly compact). <br>
<br>
Display the report based on all changes for that user since the last update via the Exit button on your Switchboard.
 
That's got me in the right direction, however I am having diffuculty in creating a command button to &quot;unlock the form&quot; to allow editing. of that individual document.<br>
<br>
Also Let's say that I have 3000 items in one table that the form is based on and I search that form for an inventoried item and that item is record 56. I'd then like to click a command button that will open record 56 in a seperate form and only one item, record 56 is available to be edited.<br>
<br>
Mark
 
Turn off the wizard before adding the button, insert into the button's OnClick event: Me.AllowEdits = True<br>
<br>
But for what you're trying to do, this might be more direct:<br>
<br>
Just use the New Form Wizard to open a single record form, from the multi-record one. It will open to the selected record. In design mode, set the multi-record form to AllowEdits=False, and the single-record form to: <br>
AllowEdits = True<br>
ViewsAllowed=Form<br>
NavigationButtons=No.<br>
<br>
This way your user will only be able to edit the one record they opened from the multi-record form, and you don't need a separate lock/unlock button.<br>

 
Thanks Elizabeth, that's put me on what I need. <br>
<br>
Next issue I have a backup of the table in question, which is backup daily in the same DB, what about a comparison query between the few items that were changed. So prior to exiting the DB it displays only those records that were changed along with what was the old data. Side by side.<br>
<br>
Thanks Again Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top