I have a front end and back end Access 2010 db. Both sit on a network and 7 users can access it. I put the following code in so the user can open a report convert it to pdf, save to a network drive that everyone has access to then fax and finally a transmission page is sent to the user’s email.
On my PC the process works as it should, however, it crashes on everyone else’s . I’m totally at a loss at to why, the front end is the same one I and everyone else use, so it can’t be an issue with a library reference.
Below is the code I’m having an issue with and this is the line where the code fails:
DoCmd.OutputTo acOutputReport, str_Report_Name, acFormatPDF, MyPath & MyFilename, False
‘DoCmd.OpenReport str_Report_Name, acViewPreview, “”, str_Where, acWindowNormal, “” ‘Opens the report
Public Sub SendFax()
Dim Cancel As Integer
Dim rsp As StringDim str_MyPath As String
Dim str_MyFilename As String
Dim str_Report_Name As String
Dim str_Where As StringDim str_FaxNum As String
Dim str_ToFaxName As StringDim oLook As Object
Dim oMail As Objectstr_MyPath = “s:Roberta PriceDrive1Drive1_PandoraRe_Faxes”
str_MyFilename = sToFaxName & “_MedRec_Request.pdf”
str_Report_Name = “rpt_Cvr_PS_Mailing_User_Select”str_FaxNum = “[FAX: ” & str_ToFaxName & “@” & Me.PCP_ProviderFAX & “]”
str_ToFaxName = Me.PCP_ProviderName
‘We need to verify if we have a FAX number for the PVD–if we don’t exit the sub
If IsNull(Me.PCP_ProviderFAX) Then
rsp = InputBox(“You must enter a FAX #!”)
If IsNull(rsp) Or False Then
Me.PCP_ProviderFAX = rsp
Me.PCP_ProviderFAX.SetFocus
GoTo Err_Need_FaxNum
End If
End If
Err_Need_FaxNum:
Exit Sub
‘We need a form to open while the conversion and faxing takes place
Call MESS(“Processing Report to PDF and sending Fax…..”)
‘Open the report and save it as PDF
‘DoCmd.OpenReport str_Report_Name, acViewPreview
DoCmd.OutputTo acOutputReport, str_Report_Name, acFormatPDF, MyPath & MyFilename, False‘DoCmd.OpenReport str_Report_Name, acViewPreview, “”, str_Where, acWindowNormal, “” ‘Opens the report
Reports!str_Report_Name.Caption = “Medical Record Request:” & MyFilename ‘Renames the Report
‘Let’s close our previewed report
‘DoCmd.Close acReport, str_Report_Name
‘Now that we have a FAX NUM and saved the report in PDF to “Drive1), we need to send the fax to the PVDSet oLook = CreateObject(“Outlook.Application”)
Set oMail = oLook.createitem(0)
With oMail
.To = str_FaxNum
.Body = “See attached”
.subject = “Medical Record Request”
.Attachments.Add str_MyPath & str_MyFilename
.Send
End With
MsgBox “Fax was sent to ” & Me.PCP_ProviderName, vbOKOnly
‘Status = “”
Set oMail = Nothing
Set oLook = NothingDoCmd.Close acForm, “frm_Please_Wait”, acSaveNo
And lastly I can’t understand why a subform changes poistion on the main form and I have the form properties set to NO on resize.
Any suggestions would be wonderful. PLEASE?