Print record

G

Guest

I have a form with a subform. When I do print record, nothing prints. When
doing a print preview, the page is completely blank. How can I fix this and
is it possible, when be able to print the main record to also print the
records from the subform?
 
A

Allen Browne

1. Create a query that uses both the main form's table and the subform's
table.

2. Double-click the line joining the 2 tables in the upper pane of the query
design window. Access pops up a box with 3 choices. Choose the one that
says:
All records from [main table], and any matches form [sub form's table].

3. Save the query. Close

4. Create a report based on this query. The wizard will walk you through the
steps. Tell it you want a Group Header on the fields from the main table,
with the items from the subform listed in the Detail section of your report.

If you then want a command button on your form to print the record in the
main form (along with the items from the subform), copy the code from this
article:
Print the record in the form
at:
http://allenbrowne.com/casu-15.html

The code saves any edits in progress, checks there is a record to print, and
opens the report. You used an outer join (step 2 above), so you should get a
report even if the subform does not have records.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

"Guiz and Access - No coding abilities"
 

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