Saving a record before viewing a report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a data entry form and a report that shows this data. There are times
when I will make a change in my data and then click my report and the
changes I just made do not appear in my report. If I completely close the
form and go back in and then run the report it shows the changes. I want to
set up some kind of macro which will first save my results and then run my
report. Can someone help me?

Thanks,
 
I have a data entry form and a report that shows this data. There are
times
when I will make a change in my data and then click my report and the
changes I just made do not appear in my report. If I completely close the
form and go back in and then run the report it shows the changes. I want
to
set up some kind of macro which will first save my results and then run my
report. Can someone help me?

I have a button on my form that has the following in the OnClick Event:

RunCommand acCmdSaveRecord
DoCmd.OpenReport "Mileage Report", acViewPreview, , "[ID]= '" & [ID] & "'"

ID is a unique identifier used here to prevent ALL records from printing.

Tom Lake
 
To save the record you are on you can also do the following.

if me.dirty then
me.dirty=false
endif


This will save any changes to the record you are on. (me.dirty is true if any
changes have been made.)

Ron
 
Back
Top