The OpenReport action was cancelled

  • Thread starter MFulton via AccessMonster.com
  • Start date
M

MFulton via AccessMonster.com

Greetings, I am still trying to learn access, I did not write this database,
however I am in charge of it. This database is in access97. Every time I
try to open this report I recieve the error listed above. I did do some
research from other's same problem, but have been unable to resolve it.
Below is the code for the report I am trying to run. Anyone's help is
greatly appreciated, and thanks in advance for you responses.



Private Sub Command4_Click()
On Error GoTo Cmd04_err
DoCmd.OpenReport rt_report, acPreview
Start_Date.BackColor = 16777215
End_Date.BackColor = 16777215
Cmd04_end:
Single_Date = False
Exit Sub
Cmd04_err:
MsgBox Err.Description
End Sub





Private Sub End_Date_GotFocus()
field = 1
End_Date.BackColor = 16627125
Start_Date.BackColor = 16777215
End Sub

Private Sub Form_Unload(Cancel As Integer)
Single_Date = False
End Sub

Private Sub Start_Date_GotFocus()
field = 0
Start_Date.BackColor = 16627125
End_Date.BackColor = 16777215
End Sub

Private Sub Form_Load()
Calendar.Day = Day(Date)
Calendar.Month = Month(Date)
Calendar.Year = Year(Date)
field = 0
If Single_Date = True Then
End_Date.Enabled = False
End If
End Sub
 
J

Jeff L

If rt_report is the name of the report you are trying to open, then you
need to put it in double quotes. Also if you are referring to fields
on your report from a form, the syntax is
Reports!ReportName!FieldName.

Hope that helps!
 
M

MFulton via AccessMonster.com

MFulton said:
Greetings, I am still trying to learn access, I did not write this database,
however I am in charge of it. This database is in access97. Every time I
try to open this report I recieve the error listed above. I did do some
research from other's same problem, but have been unable to resolve it.
Below is the code for the report I am trying to run. Anyone's help is
greatly appreciated, and thanks in advance for you responses.

Private Sub Command4_Click()
On Error GoTo Cmd04_err
DoCmd.OpenReport rt_report, acPreview
Start_Date.BackColor = 16777215
End_Date.BackColor = 16777215
Cmd04_end:
Single_Date = False
Exit Sub
Cmd04_err:
MsgBox Err.Description
End Sub

Private Sub End_Date_GotFocus()
field = 1
End_Date.BackColor = 16627125
Start_Date.BackColor = 16777215
End Sub

Private Sub Form_Unload(Cancel As Integer)
Single_Date = False
End Sub

Private Sub Start_Date_GotFocus()
field = 0
Start_Date.BackColor = 16627125
End_Date.BackColor = 16777215
End Sub

Private Sub Form_Load()
Calendar.Day = Day(Date)
Calendar.Month = Month(Date)
Calendar.Year = Year(Date)
field = 0
If Single_Date = True Then
End_Date.Enabled = False
End If
End Sub





I use this same code to open displays other reports, so actually I am not
really sure that the code is the problem, it is just giving me this error on
this specific report, anybody have any ideas on what to try next.
 
M

MFulton via AccessMonster.com

MFulton said:
Greetings, I am still trying to learn access, I did not write this database,
however I am in charge of it. This database is in access97. Every time I
[quoted text clipped - 40 lines]
End If
End Sub

I use this same code to open displays other reports, so actually I am not
really sure that the code is the problem, it is just giving me this error on
this specific report, anybody have any ideas on what to try next.


Anybody????
 
M

MFulton via AccessMonster.com

MFulton said:
[quoted text clipped - 5 lines]
really sure that the code is the problem, it is just giving me this error on
this specific report, anybody have any ideas on what to try next.

Anybody????

Also, this error occur on every computer in the building
 
M

MFulton via AccessMonster.com

MFulton said:
[quoted text clipped - 3 lines]
Anybody????

Also, this error occur on every computer in the building


The exact error is as follows:

The OpenReport action was canceled.

You used a method of the DoCmd object to carry out an action in Visual Basic,
but then clicked Cancel in a dialogue box. For example, you used the Close
method to close a changed form, then clicked Cancel in dialogue box that asks
if you want to save the changes you made to the form.


How do I correct this, is there any way to reverse what has happened???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top