refresh report

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
 
A

Allen Browne

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.
 

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

Top