Set a flag when updates occur in a subform

R

Rod Manson

I want to set a flag when updates occur in a subform, so that when the main
form closes, a number of procedures run. Can anyone suggest the most
appropriate VBA code to use please?

Thanks.
 
G

Graham R Seach

Forms have a Dirty event. Write code in that event to do whatever it is you
want to do.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
R

Rod Manson

I have declared a global variable and written code that sets a flag in the
After Update event of the subform, but I don't know how to make the main form
see it. Can you suggest what I need to do?

Thanks.
 
A

Alex Dybenko

Hi,
if you made public variable in subform's form class module, then you can
refer to it as:

Me.MySubform.Form.MyVariable

if in main form then you can refer in subform as Me.parent.Form.MyVariable

if you declared in common module - then just MyVariable


--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
 

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