Forms with sub forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Thank you for reading this question
I have a form with a subform, the sub gives all the info on a customer. That
works good
On the form is another sub form that has a sub form, this form is actually
an appointment form to be printed. All the forms are linked to the master by
phone number. The sub for the appt form is invisible. I have a macro that
opens it and prints, unfortunaltely it does not print the active record on
the main form.
I would appreciate any advice
rgds
George
 
George,

The functionality Access provides in printing forms is limited. I suggest
you create a report based on a query that brings all the information you need
into it, and print the report with a command button, filtering by the current
main form record:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "YourQuery"
stLinkCriteria = "[PhoneNumber] = " & Me![YourFormPhoneNumberControl]
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria

This code opens the report in Preview mode. To print it directly, change
acPreview to acViewNormal.

Hope that helps.

Sprinks
 
Back
Top