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

Label caption for form and displaying current record

Status
Not open for further replies.

ba4crm

Technical User
Dec 19, 2003
92
US
Hi,
I have a form with a sub-form. With the help of various threads, I was able to add cmd buttons to "save" (lock fields) and "Edit" (unlock fields to enter/update data) the form and sub-form. I added a Label on frmMain to display "Save" or "Edit" as the caption based on if I click the Save or Edit cmd buttons. It displays well, however, when I close the form and go back into it, the caption is cleared out. How can I get the caption to stay with the entry that I saved it with?
Also - when I re-open the form, the form displays the very first entry. How can I get it to display the most current record?

Thank you
 
I used the OnLoad event of the form and entered DoCmd.GoToRecord , , acLast to go to the last record in the form. Is this the correct way of doing this?
Also - I noticed that when I click the "Save" or "Edit" cmd buttons, the changes are effective for all the records. How can I limit it to just the current record and not all the records? To clarify, my "Save" button does not contain the default code for Save (DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70), but instead locks certain fields from being editted. The "Edit" button does the opposite - opens up the fields for changes. Example - cmdSave does:
Me.AllowAdditions = False
Me.AllowEdits = False
Me.lblSaveEdit.Caption = "SAVE"

How can I have these changes specific to the record I am in?
Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top