I have a few users using a vb application with access reports. Right now, one of my users have encountered an error message when she tries to print one of the reports. This problem only happens to her own pc. When she print the same report from the same copy of the vb application at other users' pc, it works well. I do not know what was wrong with her pc or is there something wrong with my codes.
Appreciate your help. Thanks
The following are the codes for the printing of the report:
Private Sub cmdPrintJobCost_Click()
MousePointer = 11
On Error GoTo errmsg
Dim msaccess As access.Application
Dim s As Variant
Dim sql As String
Dim i As Integer, c As Integer
Set msaccess = New access.Application
'ReportPath = "G:\Newgui\Finance\FinanceReports.mdb"
With msaccess
.OpenCurrentDatabase ReportPath, False
s = .Run("This_OrderIdx", OrderIdx)
.DoCmd.OpenReport "rptJobCost", acViewPreview
.DoCmd.Maximize
.Visible = True
End With
Set msaccess = Nothing
MousePointer = 0
Exit Sub
errmsg:
msaccess.Quit acExit
Set msaccess = Nothing
MsgBox Err.Description, vbInformation, App.Title
Err = 0
Unload Me
End Sub
Appreciate your help. Thanks
The following are the codes for the printing of the report:
Private Sub cmdPrintJobCost_Click()
MousePointer = 11
On Error GoTo errmsg
Dim msaccess As access.Application
Dim s As Variant
Dim sql As String
Dim i As Integer, c As Integer
Set msaccess = New access.Application
'ReportPath = "G:\Newgui\Finance\FinanceReports.mdb"
With msaccess
.OpenCurrentDatabase ReportPath, False
s = .Run("This_OrderIdx", OrderIdx)
.DoCmd.OpenReport "rptJobCost", acViewPreview
.DoCmd.Maximize
.Visible = True
End With
Set msaccess = Nothing
MousePointer = 0
Exit Sub
errmsg:
msaccess.Quit acExit
Set msaccess = Nothing
MsgBox Err.Description, vbInformation, App.Title
Err = 0
Unload Me
End Sub