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

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
 
A

Alex White MCDBA MCSE

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.
 
S

Steve Huff

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
 
J

JW

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

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

Jason
 
J

JW

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
 
Top