It is unclear how this could happen. Do you have both buttons assigned to
the same macro.
You can get the button caption that called the routine with
sButtonName = Application.Caller
and have your code conditionally execute.
Regards,
Tom Ogilvy
Quote:
> I'm feeling somewhat stupid this morning but I can't solve a minor
problem. I have a dialog box "dialog 1" with several edit boxes and a
button (button 2) named "Add" and a button (button 3) named "Cancel". When
the user enters data and "Add" everything works just fine. When "Cancel" is
pressed the procedure continues and adds a blank record.
Quote:
> How do I capture the button press and simply "End"? i.e.
> If dialogbox.buttonpress=cancel
> end
> end if
> Sorry for the brain block this Saturday morning ...
> Best Regards,
> David
> C.M. Consultants,Inc