View Full Version : Solved: cancel parameter in macros

11-10-2008, 07:46 AM

I have been reading about writing my own events and have seen the optional cancel parameter described as a very useful and professional tip

I have been trying to find an example piece of code which uses this parameter with a description of what it does

I dont know about anyone else but I find good code examples the best way to learn


Bob Phillips
11-10-2008, 08:04 AM
What are you wanting to write your own events to do?

11-10-2008, 08:14 AM
Well, in Access the AfterUpdate Event has a Cancel parameter. I don't know about Excel off the top of my head.

The Cancel parameter is a boolean that you can use to cancel the event. Using the AfterUpdate event above as an example, if you set Cancel = True then the update event will be canceled- it won't happen. This could be useful if a required textbox is empty, for instance.