Save button on pop-up form
Posted on 2011-03-25
Hi! I've got a Microsoft Acces form with a drop-down list providing customer names so I've added edit and new buttons to open the customers form to allow users to add/edit customer here, after which they hit the exit button to return to the main form, I then refresh the customers combobox on the lost focus event for the new/edit buttons, that is all great. Now...
The customer has come into the habit of adding Save buttons to all their forms and have requested I do the same to keep the same format. So the exit button is disabled until you hit the save button, which then does the usual "DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70" to save the record.
So the problem I've got is since I've added the Save button to the customers form, when they hit Save, Access tries not only to save the current record on the Customers form but also on the form behind it, which won't be complete at this stage and they get error messages about required fields not being complete.
So is there a way of getting the save button to only save the record on the form in focus?
As I've this typed now I've realised I can just remove that code and let Access do it's saving on exit anyway but it's a bit of a fudge. Any other ideas?