refresh report

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

I am trying to open and populate a report from a form:

DoCmd.OpenReport "rptHPTemp", acViewPreview
Set rpt = Reports!rptHPTemp
rpt!HxP = Me.ClinNote

The control HxP is unbound and when I step through this, rpt!HxP does show
the data is passed from Me.ClinNote. When I view the report, HxP is blank. I
have looked for a way to refresh the report but can't find anything. When I
close and reopen the report, HxP is appropriately populated with the data.
How can I refresh the report without closing and opening?

Thanks,
Sam
 
Unlike forms, reports don't have a 'current' record, so you cannot assign a
value to a control after it is opened.

Perhaps you could have the report read the value from the form, i.e. set the
Control Source of the text box on the report to something like this:
=[Forms].[Form1].[ClinNote]

Or, you can use the the Format event of the section that contains the HxP
control to assign a value to it.
 
Back
Top