data entered through form

J

JIM.H.

Hello,
I have a form I created with a form wizard that displays
fields from a table. In the form I have a button that
calls a function to export data to excel file. My problem
is when I open form and change data and click button to
export, it does not export the latest change I have done.
But I no the modification is there because when I close
the form, open it again and click, it exports all changes
I made before, what is problem? When I modified data in
the form, when is it written to the table?
Thanks,
Jim.
 
F

fredg

Hello,
I have a form I created with a form wizard that displays
fields from a table. In the form I have a button that
calls a function to export data to excel file. My problem
is when I open form and change data and click button to
export, it does not export the latest change I have done.
But I no the modification is there because when I close
the form, open it again and click, it exports all changes
I made before, what is problem? When I modified data in
the form, when is it written to the table?
Thanks,
Jim.
Jim,
Access doesn't save the new data until you go to a different (or new)
record, close the form, or explicitly save it.
Add a line of code to the command button used to export the data:

DoCmd.RunCommand acCmdSaveRecord
Then do your regular stuff.
 

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