Thanks June7 for the reply. I've found this forum to be incredibly useful in the past, I just wanted to be sure I wasn't doing something wrong. Not a complaint at all, I'm very grateful for any help that I can get. Also, I just figured out how to wrap the code, my apologies for the readability problem.
Below is code for the on load event for the sub forms that contain the images.
Code:
If IsNull(ENHServiceImagePath1) Then
Me.imgServAttmt1.Height = 0
Me.Detail.Height = 0
Else
Me.imgServAttmt1.Height = 5750
Me.Detail.Height = 5750
End If
Below is code behind "Export To PDF" button.
Code:
Private Sub cmdExportPDF_Click()
On Error GoTo cmdErrHandler
Dim intEstNum As Integer
intEstNum = Me.EstimateID
DoCmd.Close acForm, "ENHfrmProposal", acSaveYes 'close forms that are open to speed up export process
DoCmd.Close acForm, "ENHfrmChooseProposalNEW", acSaveYes 'close forms that are open to speed up export process
Me.ENHfrmProposal_Images_Attmt1.SetFocus 'set focus to sub form image 1
Me.ENHfrmProposal_Images_Attmt2.SetFocus 'set focus to sub form image 2
DoCmd.OutputTo acOutputReport, "ENHrptEnhanceProposal_WithOutServicePricing", acPDF, , True, , , acExportQualityPrint
DoCmd.Close acReport, "ENHrptEnhanceProposal_WithOutServicePricing", acSaveYes
DoCmd.OpenForm "ENHfrmProposal", , , "[EstimateID] = " & intEstNum, , acWindowNormal 're-open form where user was working before the export process
cmdErrHandler:
Select Case Err.Number
Case 3048
MsgBox "Unexpected Error, Please Close the Databse and Reopen", vbCritical, "Error" 'this was for "Cannot Open Any More Databases", I've since simplified source for report to eliminate this
Case 2501
MsgBox "The Existing PDF File Is Currently Open, Please Close and Try Again", vbCritical, "Error"
Case 0
Exit Sub
Case Else
MsgBox Err.Number & ": " & Err.Description & ": cmdExportPDF_Click"
End Select
End Sub