Solved Issue Filling Report fields based on a previous form

theferd

Registered User.
Local time
Yesterday, 21:31
Joined
Dec 23, 2019
Messages
42
I'll preface this issue that I have little experience with reports in relation to the code builder.
What I am trying to accomplish is filling in several text boxes on my report using combo boxes that a user would select on a previous form.
For example:
Code:
DoCmd.OpenReport "Singlesourcedreport", acViewPreview
Reports!Singlesourcedreport.txtcatalog = Me.txtcatalog

Other lines are similar direct transfers and DLookup.controlsource, etc.
The issue is that the report preview does not seem to update these fields. I assume this is because of how the openreport command generates based on initial values of each text box. I tried OpenArgs or opening the report again, but none of these seemed to change anything. Is there a crucial step that I'm missing here or another way around this or is this a hard limitation for Access
 
fill the report from a query ,based on the form items.
select tbl.date, forms!myform!txtBox1 from table.

dont fill it post opening the report, let the query grab everything.
 
If the "previous form" is still open (it has to be if you want this to work) then simply open the report in design view and in the controls you want to be populated from the form use the control source to reference the form controls: =Forms!frmSingleSource!txtcatalog

Cheers,
 
Ill give both methods a try and return with results. Thanks
 
Report View doesn't run all your code. Only Print Preview and Print will run all your code.

It's quite the conundrum. If you want the "live" features of report view, you give up the ability to run parts of your code.
 
So I ended up using a mixture of cross tab references for more basic text fields and query generation for dynamic lists on my report. The formatting is a bit scuffed but it appears to be working correctly. Thanks all.
 

Users who are viewing this thread

Back
Top Bottom