Data refreshing

  • Thread starter Thread starter Fred's
  • Start date Start date
F

Fred's

Hi Folks,

I have a problem, which I hope to solve with your help!.

After doing data entry on my form, I open my report with a command
button. The problem is that I have to press F9 on my keyboard to
refresh the data before opening my report. Otherwise, the report
doesn't take the changed.
Why this is happening? And what will be the solution, so that my
report takes the changed automatically

Thanking you all in advance for your continuous support

Fred's
 
Hi Folks,

I have a problem, which I hope to solve with your help!.

After doing data entry on my form, I open my report with a command
button. The problem is that I have to press F9 on my keyboard to
refresh the data before opening my report. Otherwise, the report
doesn't take the changed.
Why this is happening? And what will be the solution, so that my
report takes the changed automatically

Thanking you all in advance for your continuous support

Fred's

Access doesn't save new data until you navigate to another record,
close the database, or expressly tell it to save the new data.
Code the button's click event:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "reportName" , etc.....
 
Access doesn't save new data until you navigate to another record,
close the database, or expressly tell it to save the new data.
Code the button's click event:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "reportName" , etc.....

Hi Fredg,

That seems to work, but at the same time that my report refresh, the
report print, why? and how to solve the problem

Fred's
 
Hi Fredg,

That seems to work, but at the same time that my report refresh, the
report print, why? and how to solve the problem

Fred's


Well, the ...etc.. mean your supposed to fill the additional arguments
of the OpenReport to just display the report instead of printing it,
and to select the correct record. The correct code is probably the one
that you are currently using. I certainly don't know what your code
is. I can't see it.
All you had to do is add the Docmd.RunCommand code to first save the
record before running the report.

Perhaps it would look like this generic code:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName",acViewPreview, , "[RecordID] = " &
[RecordID]

Change "RecordID" to whatever the record's actual prime key field name
is that uniquely identifies each record.
 

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