L
Les Coover
Access NT, form consists of Main form with
subformA and subformB as part of main form.
Relationship: Main > (1 to many) subformA > (1 to many) subformB
Referential integrity enforced.
The following is the code associated with a print record
command button on the Main form
Private Sub Command28_Click()
On Error GoTo Err_Command28_Click
'---print record command button
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection
Exit_Command28_Click:
Exit Sub
Err_Command28_Click:
MsgBox Err.Description
Resume Exit_Command28_Click
End Sub
As long as the first record in subformA is ACTIVE everything
works fine. The record is printed with Main form information,
1st record of subformA record and associated subformB
records.
But when any record after the first subformA record is
selected (subformA record 2 or subformA record 3
or subformA record 4 etc)
only the Main form info and subformA record is printed,
the associated subformB records are blanked out.
Although the correct subformA record is printed, the
associated subformB recrods are not.
How can I fix this so the print record option
will work and correctly?
Everything else works fine on the form, it is just the
print record option that I can't get to work.
Thanks for any help.
Les
subformA and subformB as part of main form.
Relationship: Main > (1 to many) subformA > (1 to many) subformB
Referential integrity enforced.
The following is the code associated with a print record
command button on the Main form
Private Sub Command28_Click()
On Error GoTo Err_Command28_Click
'---print record command button
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection
Exit_Command28_Click:
Exit Sub
Err_Command28_Click:
MsgBox Err.Description
Resume Exit_Command28_Click
End Sub
As long as the first record in subformA is ACTIVE everything
works fine. The record is printed with Main form information,
1st record of subformA record and associated subformB
records.
But when any record after the first subformA record is
selected (subformA record 2 or subformA record 3
or subformA record 4 etc)
only the Main form info and subformA record is printed,
the associated subformB records are blanked out.
Although the correct subformA record is printed, the
associated subformB recrods are not.
How can I fix this so the print record option
will work and correctly?
Everything else works fine on the form, it is just the
print record option that I can't get to work.
Thanks for any help.
Les