Hi all,
I'm making some changes to the images that go out on certain reports. I have a report that is tied to a combobox of client ID's and produces a single report but has an image I want to change. I need to produce a second report, with a different logo, if the client ID is equal to one of two values.
First I tried:
Then I tried:
The first code block successfully produced a report for the first ClientID. My database crashed when I used the second code block to try and get the report for the second ClientID.
Thanks for any assistance!
I'm making some changes to the images that go out on certain reports. I have a report that is tied to a combobox of client ID's and produces a single report but has an image I want to change. I need to produce a second report, with a different logo, if the client ID is equal to one of two values.
First I tried:
Code:
'If statement to allow for new rptLettersSBD when ClientID = ABC001 or ABC002
If ((Forms!frmLetter.cmbClientID = "ABC001") Or (Forms!frmLetter.cmbClientID = "ABC002")) Then
DoCmd.OutputTo acOutputReport, "rptLetterSBD", acFormatPDF, PDFFileName, False
Else
DoCmd.OutputTo acOutputReport, "rptLetterBranded", acFormatPDF, PDFFileName, False
End If
Then I tried:
Code:
'If statement to allow for new rptLettersSBD when ClientID = ABC001 or ABC002
If Forms!frmLetter.cmbClientID = "ABC001" Then
DoCmd.OutputTo acOutputReport, "rptLetterSBD", acFormatPDF, PDFFileName, False
ElseIf Forms!frmLetter.cmbClientID = "ABC002" Then
DoCmd.OutputTo acOutputReport, "rptLetterSBD", acFormatPDF, PDFFileName, False
Else
DoCmd.OutputTo acOutputReport, "rptLetterBranded", acFormatPDF, PDFFileName, False
End If
The first code block successfully produced a report for the first ClientID. My database crashed when I used the second code block to try and get the report for the second ClientID.
Thanks for any assistance!
Last edited: