exit subform

G

Guest

I would like to execute code when exiting a subform:

Private sub MySubform_exit(Cancel as integer)

If the subform is dirty, this code executes, otherwise it appears that when
I move off the subform, nothing happens. Is there another event I can use or
how do I use brute force to make it visit this code whenever the focus moves
off the subform? My options appear to be OnEnter and OnExit.
Thanks again!!
 
T

tina

Private sub MySubform_exit(Cancel as integer)

the posted procedure "header" is from the main form's module, on the Exit
event of the subform *control*, correct? i tested a subform control exit
event in an A2000 db running in A2003, and the event fired each time the
control was exited, regardless of the subform's Dirty status.

suggest you either put a break on the procedure, or put a MsgBox at the
beginning of the procedure code, to see if the event is firing. it's
possible that the problem is with the code in the procedure, not the event
itself.

hth
 
G

Guest

Really appreciate the input. I did use a msgbox to confirm that subform exit
wasn't firing. But the form is complicated and moving from one tab to the
next. So i was able to resolve the issue by putting code on the tab change
event.

Sam

tina said:
Private sub MySubform_exit(Cancel as integer)

the posted procedure "header" is from the main form's module, on the Exit
event of the subform *control*, correct? i tested a subform control exit
event in an A2000 db running in A2003, and the event fired each time the
control was exited, regardless of the subform's Dirty status.

suggest you either put a break on the procedure, or put a MsgBox at the
beginning of the procedure code, to see if the event is firing. it's
possible that the problem is with the code in the procedure, not the event
itself.

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top