I have a very weird problem and hope someone can help me.
I have a main form (frmChangeOfControlForm) and it contains a tab control. Inside the tab control I have 2 pages. The first page has two subforms (one base on a table and one base on query). I don't have anything in the second page yet.
Everything works fine except when I edit other controls in the main form and accidentially "CLICK" in these subform area, Access will do a save on the record. I really don't want this to happen especally when I am adding new record as I may not want to save the record at all.
All in all, I want to save any updated record and new record when I actually hit the save button in the main form.
Yes. Sorry, I was being a bit vague there. To clarify:
Unbind the fields on the main form, with the exception of the key field. By doing that, the mainform's content (which the user might modify) is disconnected from the underlying recordset and therefore won't be effected by stray clicks that may force a save. Only your save button will do the saving.
But... the bigger question is "Is it worth it?". Why not just allow the save? If you later decide you don't want to allow the save, just delete the record? It's certainly less work for you.
I really need to think about your suggestion carefully. This particulare form was intended not to allow any deletion. This is part of the Business Continuity solution for the company. We don't want user to be able to delete the form. May be I need to convince them to allow the deletion. Maybe completely lock down those approved forms.
Not necessarily. You can disallow users the ability to delete records with a form and in that same form, code can be written to delete records. So you can have a form where users cannot delete records with and if your logic should determine that the record should never have been entered (after a save) then you could automatically delete the record.
However, it is also true that you should carefully consider allowing users to delete records (at least some of them) otherwise mistaken entries can clutter up your data - destroying the integrity of reports until a manager deletes mistaken data (if it's ever reported).