Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: cancel outlook express from access without a message

0 views
Skip to first unread message

Tom Wickerath

unread,
Dec 29, 2005, 12:58:01 PM12/29/05
to
Hi John,

Trap for error 2501 in the error-handler. Here is an example I use all the
time if a report includes no data (my reports include a nodata event
procedure, which cancles opening the report, which generates the same error
2501):

Private Sub cmdPreviewOrders_Click()
On Error GoTo ProcError

DoCmd.OpenReport "rptOrders", acPreview, _
WhereCondition:="OrderID = " & Me.OrderID

ExitProc:
Exit Sub
ProcError:
Select Case Err.Number
Case 2501 'No Data
Case Else
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in cmdPreviewOrders_Click event
procedure..."
End Select
Resume ExitProc
End Sub


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

"Johnplat" wrote:

I added a button to call outlook express with docmd.sendobject. It works just
fine if I sendf a message. If I just close outlook express without any
message, I get an error 2501 Send Object action was cancelled. How can I
eliminate this message, if I don't send a message in outlook express?

Johnplat

unread,
Dec 29, 2005, 1:43:04 PM12/29/05
to
Tom,
Thanks, works like a charm.
John
0 new messages