How would to have VBA put the data into a report?

S

Steve Steiner

Hi all,

Here is the scenario: I have a database with 2 tables in it. Table1 has a
one-to-many relationship with table2. I would like my script to loop through
table1 a row at a time and put data into a report. Table2 would be a
sub-report linked to a custom field that would be filled in by the VBA code.
Each row would generate one report that would be printed or have a pdf file
generated. On the report I have created custom fields and named them. How
do I have VBA code fill the custom fields with data from table1 as it is
read? I know how to do this using forms, but can not get it to work with
reports. With what I have coded I get the following error:
The report name "MyReport" you entered is misspelled or refers to a report
that isn't open or doesn't exist.

Thank you.
 
D

Duane Hookom

You should start a question like this with the reason you don't just bind
the reports to your tables or queries. There is generally no need to use
code to place values into controls on reports.
 

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