Navigation buttons and form closing button.

  • Thread starter Thread starter Gideon
  • Start date Start date
G

Gideon

I need to take certain action when the user pushes a navigation button.
Using "OnCurrnet" event will tell me that I already moved to another
record. I need to act before moving but after clicking a navigation
button. I actually also need to know if it was a new record navigation
button or one of the other. Is there any way to identify this event in VBA?

I also need to select what action to take when close button is
pushed("x" on the top right of the form). In other words I will use the
OnClose property and chose a function that be executed when the "x" is
clicked. I do not know, however, how to identify in VBA the clicking on
the "x".

Any help will be appreciated.

Gideon
 
Gideon,

You can execute code before "leaving" the record with the use of the
Before Update event of the form, if the form is bound, but I don't think
there's a way to tell if the next(previous), last(first) or new record
button was clicked. Likewise, you could use the On Close event but that
would also fire upon closing the form programatically or closing the
database while the form is open, not just by clikcing the "x"; not sure
if this is what you want. I guess the best way to get what you want is
to disable the "x" button and the navigation buttons in your form
design, and use your own custom buttons instead.

HTH,
Nikos
 
Back
Top