Changing a value in a field on a form does not update the field inthe Table right away.

  • Thread starter Thread starter JW
  • Start date Start date
J

JW

After changing the number in a field I click a button to open another
form. There I print a report that uses the information in the field.
However it is using information from the table and the table has not
been updated with the data I put in the field. What is the easiest way
to save this field to the table after it has been updated.


This has got to be a simple fix, but my mind is blanking on how to do it.

Thanks,

Jason
 
This is by design,

if you want to data the data at any point

if me.dirty = true then
docmd.runcommand accmdsaverecord
end if

you may want to put this in the click event for the button just before you
are opening your new form, it is not a good idea to make the database try
and save all the time as you will generate a lot more traffic and will slow
your app done, records are saved automatically when you move from one record
to another.

hope it helps.
 
The easies way - make sure your form and control are bound to the data source
your report is pulling from. If they are bound you shouldn't need to do
anything else.

-Steve Huff
 
Thanks Alex,
I put those lines in and I received the following error.

The commmand or action 'Save Record' Isn't available now.

Jason
 
All of you, thanks for the help!

Problem solved and quickly!!

I was trying to step through the code you gave me with the debugger. I
didn't realize that the debugger doesn't like the "docmd.runcommand
accmdsaverecord" but if you run it without the debugger it works just fine.

Thanks again,

Jason
 

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

Back
Top