Save button problem

J

Jeff

Hi everyone,

I have a main form with a subform in it. I use the button wizard to generate
a save button to give save command for the subform. I put the button on my
main form but it doesn't work. The code in my Save button's On Click event is:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Should I revise or add something? Any help is appreciated.
 
O

Ofer

Hi Jeff,
If the save button is on the main form, when the sub form lose it focus it
will automatically save the records in the sub form, so there is no need for
the save button.
Unless all the fields in the sub form are unbound, in that case you need
insert/update the records in the table.
Some more information on how the form/sub form functions will be useful.
 
J

Jeff

Hi Ofer,

Yes, my subform is bound and it will automatically save the records when it
loses its focus. The point is that I have another "Undo" button on the main
form that is not working. I have to post my question for the "Undo" button
but not the "Save" button in my last post. I don't know why Access puts a
"Save" button that is not really necessary.

Now, come back to my problem. Is there someway to get the "Undo" button on
the main form works for the subform? What I am thinking is I can put a
working "Undo"button on the subform and make it invisible. Then put another
button on the main form to trigger the invisible "Undo" button when it is
pressed. I have not tested it yet and this doesn't seem to be a formal way.
Any further help is welcome.
 
O

Ofer

The Save button can be used to save the records on the main Form, so is the
undo button.
The records are saved automatically as you exit the sub form back to the
main form, or when you move from one record to another, and you can't undo
this changes using the undo button.
Mybe there is a better way to resolve this problem but I use a temp table,
that updated every time the form is open, and incase of undo, it will
retrieve the old values, there is some code involved on doing that
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top