Hi,
I have a form that loads from a menu option. The form has two subforms. All the specs are divided in groups within the forms and subforms. The forms depend on 3 queries that have all the tables correctly gathered. So, every title has a little print button next to it if the user wants to only print that group; if he or she wants to print the entire form, there is a button for that at the end of the form. I am currently having problems with the groups printing. Given that they mostly depend on a separate table and not the general one, every time I click any of the little buttons, I end up printing all the records in that table. I would like to be able to print only the info seen at the moment on the form.
Here is the code of one of the groups:
Private Sub Print_OperatingMechanism_Click()
On Error GoTo Err_Print_OperatingMechanism_Click
Dim stDocName As String
stDocName = "OperatingMechanism"
DoCmd.OpenReport stDocName, acViewPreview
Exit_Print_OperatingMechanism_Click:
Exit Sub
Err_Print_OperatingMechanism_Click:
MsgBox Err.Description
Resume Exit_Print_OperatingMechanism_Click
End Sub
Thanks in advance...
I have a form that loads from a menu option. The form has two subforms. All the specs are divided in groups within the forms and subforms. The forms depend on 3 queries that have all the tables correctly gathered. So, every title has a little print button next to it if the user wants to only print that group; if he or she wants to print the entire form, there is a button for that at the end of the form. I am currently having problems with the groups printing. Given that they mostly depend on a separate table and not the general one, every time I click any of the little buttons, I end up printing all the records in that table. I would like to be able to print only the info seen at the moment on the form.
Here is the code of one of the groups:
Private Sub Print_OperatingMechanism_Click()
On Error GoTo Err_Print_OperatingMechanism_Click
Dim stDocName As String
stDocName = "OperatingMechanism"
DoCmd.OpenReport stDocName, acViewPreview
Exit_Print_OperatingMechanism_Click:
Exit Sub
Err_Print_OperatingMechanism_Click:
MsgBox Err.Description
Resume Exit_Print_OperatingMechanism_Click
End Sub
Thanks in advance...