Report not printing from form unless I enter data then double click on rpt

ptc

New member
Local time
Today, 17:20
Joined
Jun 8, 2009
Messages
4
I'm trying to help someone correct a problem with their Access database. The database features worked and a consultant was hired to make some changes to the database and since that time there a few issues that they've been running into. They have a form that they enter date range data into. It then runs a query and it should show a report print screen. When they do this they receive the following error: The Microsoft Access database engine could not find the object 'rptQuotationLog_Period'. Make sure the object exists and that you spell its name and the path name correctly. If I then find the report in the navigation pane and double click on it the print preview is then printed.

Does anyone know how I can troubleshoot this.
 
Please do not double post

Is the report name correct? is it actually 'rptQuotationLog_Period'
 
When I go into design view of the form open the code it shows the following:

Option Compare Database

Private Sub cmdClose_Click()
On Error GoTo Err_cmdClose_Click

DoCmd.Close
Exit_cmdClose_Click:
Exit Sub
Err_cmdClose_Click:
MsgBox Err.Description
Resume Exit_cmdClose_Click
End Sub
Private Sub cmdPreview_Click()
On Error GoTo Err_cmdPreview_Click
Dim stDocName As String
stDocName = "rptQuotationLog_Period"
DoCmd.OpenReport stDocName, acViewPreview, stDocName
Exit_cmdPreview_Click:
Exit Sub
Err_cmdPreview_Click:
MsgBox Err.Description
Resume Exit_cmdPreview_Click
End Sub


Sorry for the double post. I though I received a log off message so I figured it was not posted.
 
DoCmd.OpenReport stDocName, acViewPreview, stDocName

Should read

DoCmd.OpenReport stDocName, acViewPreview
 
That worked. Thank you very much!!!
 

Users who are viewing this thread

Back
Top Bottom