Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On NoData in Acess 97

Status
Not open for further replies.

Freckles

Technical User
May 1, 2000
138
0
0
US
I just read machineboy's problem, and it is very similar to mine, but enough different for me to start a different thread "I think".

I created a macro with a MsgBox to appear when the NOData event happened. Then "CancelEvent". The msg box worked perfectly. BUT, then I got the following message

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

When I said "OK" to the Access message, the form was there just like I wanted it to be.

QUESTION: How can I stop the Access generated message from appearing?

DUH??

Here is the code behind "on click" on the form that causes the report to Preview.

Private Sub PLMReport_Preview_Click()
On Error GoTo Err_PLMReport_Preview_Click
If Me.Dirty Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
End If

Dim stDocName As String

stDocName = "PLM Product Report"
DoCmd.OpenReport stDocName, acPreview

Exit_PLMReport_Preview_Click:
Exit Sub

Err_PLMReport_Preview_Click:
MsgBox Err.Description
Resume Exit_PLMReport_Preview_Click

End Sub


::) Deb Koplen
deb.koplen@verizon.com

A person can stand almost anything except a succession of ordinary days.
 
That is almost the same problem I have except I am using Access 95 and I use an Event Procedure instead of a Macro to handle the NoData Event
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top