Checking if subform is dirty

J

Jason

How do I check to see if a subform is dirty? The only work around I can
think of namesubform.requery.

Thanks,
J.
 
S

strive4peace

Hi Jason,

if me.subform_controlname.form.dirty then

WHERE
subform_controlname is the Name of the control containing the subform


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
:) have an awesome day :)
*
 
M

Marshall Barton

Jason said:
How do I check to see if a subform is dirty? The only work around I can
think of namesubform.requery.


If the focus is in the main formor another subform, then the
subform should not be dirty because any changes/additions
were saved when the focus moved away from the subform.

If the subform is checking itself, then it's simply:
If Me.Dirty Then
 
J

Jason

if checking itself then it is checking form. I'll check if subform remains
dirty after going back to main form to make sure of this before I print the
report.
I already have that command on the parent form for checking itself. The
caommand buton is on the parent form but if I haven't gone from editing
current record in the subform to either a new record or another record then
I would have thought dirty = true.
 
M

Marshall Barton

Jason said:
if checking itself then it is checking form. I'll check if subform remains
dirty after going back to main form to make sure of this before I print the
report.
I already have that command on the parent form for checking itself. The
caommand buton is on the parent form but if I haven't gone from editing
current record in the subform to either a new record or another record then
I would have thought dirty = true.


Going from the subform to the main form should save any
changes the same as going to a different record in the
subform.

The situation that I am unsure of is when a VBA procedure in
the main form sets values in the subform. Clearly this
would make the subform dirty without a save, but if/when the
modified subform record is saved is unclear unless the main
form procedure explicitly does it.
 

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