Home  Fees/Services  Access Templates  Tutorials  Access Download  Articles  Search  Contact  Privacy  Links

DoCmd Examples - Access 2007 VBA
Cancel Event DoCmd

Docmd Macro VBA Example Macro DoCmd Functions





DoCmd AddMenu
DoCmd ApplyFilter
DoCmd CancelEvent
DoCmd Close
DoCmd CopyObject
DoCmd DeleteObject
DoCmd FindRecord
DoCmd FindNext
DoCmd GotoControl
DoCmd HourGlass
DoCmd Min/Max/Restore
DoCmd OpenForm
DoCmd OpenQuery
DoCmd OpenReport
DoCmd OutputTo
DoCmd RunSQL
DoCmd SendObject
DoCmd TransferDatabase
DoCmd TransferText

Create Export Specs



Access DoCmd CancelEvent Method Example

The Cancel Event action method cancels the event that caused Microsoft Access to run the code containing this action

The CancelEvent method has no arguments and can be called directly using the syntax DoCmd.CancelEvent. This Access method has an effect only when it's run as the result of an event. This method cancels the event.

All events that can be canceled in Visual Basic have a Cancel argument. You can use this argument instead of the cancel event method to cancel the event. The KeyPress event and MouseDown event (for right-clicking only) can be canceled only in macros, not event procedures, so you must use the cancelevent action in a macro to cancel these events.

Below is a summary table showing which events can be cancelled using the cancel event method.
 

ApplyFilter

Dirty

MouseDown

BeforeDelConfirm

Exit

NoData

BeforeInsert

Filter

Open

BeforeUpdate

Format

Print

DblClick

KeyPress

Unload

Delete

 

 

 

More examples of canceling an event:

Access Undo Event Example

Private Sub Form_Undo(Cancel As Integer) If MsgBox("Do you want to cancel the Undo?",vbYesNo) = vbYes Then Cancel = True Else Cancel = False ...
www.blueclaw-db.com/access_event_programming/undo.htm

BeforeUpdate Event in Access Database

Private Sub Due_Date_BeforeUpdate(Cancel As Integer) If Me.Due_Date<Me.Start_Date then Msgbox "The Due Date must not come before the Start Date" Cancel=True ...
www.blueclaw-db.com/access_event_programming/beforeupdate.htm




Site Search:

Custom Search





Templates, Examples & Case Studies

Order Management Software

Inventory Management System

Interior Design Project Management Solution

Contact Management Database Application

Construction Project Management

Lease Contract Management

Livestock Feed Inventory

CRM/Customer Relationships Management

Order Processing System

PM/Preventive Maintenance

Work Order Software

Real Estate Marketing

Reservations Management

Asbestos Survey Management System

Document Revision Management

HOA Database Template

Loan Processing Management

Student Grant Management Software

Personnel Agency Database

Prescription Assistance Plan Management

Subscription Order Management Software

Corporate Document Management Application











Contact Information

Custom Software Developers
MS Access 2007 2003 2000 All Windows Versions