Questions about writing data to text box in a report...

J

jpang

Hello,

I am trying to write data to textboxes in a report. I am using the same
procedure as that for forms. The following is a section of my code.

Report_r_BudgetReport.CID = CID
Report_r_BudgetReport.Community = BComm
Report_r_BudgetReport.Visible = True

where CID is a variable containing the value that I want to pass into the
object Report_r_BudgetReport.CID on my report and BComm is a variable
containing data that I want to pass into the object
Report_r_BudgetReport.Community. When I executed the above code, the report
was blank. When I checked my code, the proper data were passed into the
objects. However, for some reasons, the data were not showing up on the
report when the report was opened. I tried to investigate whether there was
any requery or repaint method for the report form, but I could not find any.
Am I looking into the wrong places?

Thanks for your help.
 
A

Allen Browne

You can't do that with reports. They work very differently to forms, e.g.
there is no current record that you can assign records to on a report.

Instead of trying to assign the values to the text box after the report
opens, use the Format event of the section that contains the text boxes. For
example, if CID is in the Detail section, in the report's Detail section's
Format event procedure you could code:
Me.CID = Forms!Form1!Text0
 

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

Similar Threads


Top