Hi
I've made this code for printing out 4 different reports. The reports are as following: Invoice (Faktura), Specifikations1 (FakturaSpec), problem is that every time I open these repports, I only need "Faktura" and one of the 3 specifications. The remaning 2 are empty. But they will be generatet anyway.
Here is the code:
Private Sub Fakturanr_DblClick(Cancel As Integer)
Dim stLinkCriteria As String
Dim File1 As String
Dim File2 As String
Dim File3 As String
Dim File4 As String
File1 = "Faktura"
File2 = "FakturaSpec"
File3 = "FakturaSpecPakker"
File4 = "FakturaSpecTeknik"
stLinkCriteria = "Fakturanr=" & Me!Fakturanr
DoCmd.OpenReport File1, acViewPreview, , stLinkCriteria, , acNormal
On Error GoTo Faktura_Err
stLinkCriteria = "Fakturanr=" & Me!Fakturanr
DoCmd.OpenReport File2, acViewPreview, , stLinkCriteria, , acNormal
On Error GoTo Faktura_Err
stLinkCriteria = "Fakturanr=" & Me!Fakturanr
DoCmd.OpenReport File3, acViewPreview, , stLinkCriteria, , acNormal
stLinkCriteria = "Fakturanr=" & Me!Fakturanr
DoCmd.OpenReport File4, acViewPreview, , stLinkCriteria, , acNormal
On Error GoTo Faktura_Err
Faktura_Exit:
Exit Sub
Faktura_Err:
MsgBox Error$
Resume Faktura_Exit
End Sub
Is there anyway I can avoid having these 2 empty reports?
Best regards
Ole
I've made this code for printing out 4 different reports. The reports are as following: Invoice (Faktura), Specifikations1 (FakturaSpec), problem is that every time I open these repports, I only need "Faktura" and one of the 3 specifications. The remaning 2 are empty. But they will be generatet anyway.
Here is the code:
Private Sub Fakturanr_DblClick(Cancel As Integer)
Dim stLinkCriteria As String
Dim File1 As String
Dim File2 As String
Dim File3 As String
Dim File4 As String
File1 = "Faktura"
File2 = "FakturaSpec"
File3 = "FakturaSpecPakker"
File4 = "FakturaSpecTeknik"
stLinkCriteria = "Fakturanr=" & Me!Fakturanr
DoCmd.OpenReport File1, acViewPreview, , stLinkCriteria, , acNormal
On Error GoTo Faktura_Err
stLinkCriteria = "Fakturanr=" & Me!Fakturanr
DoCmd.OpenReport File2, acViewPreview, , stLinkCriteria, , acNormal
On Error GoTo Faktura_Err
stLinkCriteria = "Fakturanr=" & Me!Fakturanr
DoCmd.OpenReport File3, acViewPreview, , stLinkCriteria, , acNormal
stLinkCriteria = "Fakturanr=" & Me!Fakturanr
DoCmd.OpenReport File4, acViewPreview, , stLinkCriteria, , acNormal
On Error GoTo Faktura_Err
Faktura_Exit:
Exit Sub
Faktura_Err:
MsgBox Error$
Resume Faktura_Exit
End Sub
Is there anyway I can avoid having these 2 empty reports?
Best regards
Ole