Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make mainform dirty when sub-subform is dirty

Status
Not open for further replies.

projecttoday

Programmer
Feb 28, 2004
208
US
I have a form with a subform on it that has a datasheet subform on that. The mainform has a close button with do-you-want-to-save logic behind it. If the user makes a change on the datasheet sub-subform I want the logic on the main form to recognize it. I tried using

Me.Parent.Parent.Dirty = True

in the on dirty event of the sub-subform and I got an error message. So my question is how can I make the main form know when something has been changed on the sub-subform?
 

I think this needs to be a "single parent" family! ;0)>

Try using 'parent' only once:

Me.Parent.Dirty = True



The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
When I try that I get the following error:
Run-time error 7768
In order to change data through this form, the focus must be in a bound field that can be modified.

This is a sub-subform.
 
How are ya projecttoday . . .

Be aware: wile navigating between subforms & mainform ... any time the focus is transferred to a different form or subform ... any new or preciously edited record is automatically saved!. Meaning, when you edit a record on the subform in datasheet view and then move the focus to the button on the mainform ... the record in the datasheet is automatically saved. This makes the [blue]On Dirty[/blue] property useless for your needs.

I detect you need to rehash some logic here.

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Then what would you suggest? I would like it so the user can back out of any changes by closing the screen. The rest of the forms in the database have been programmed this way. I have an unbound form on which there is a single record subform with a datasheet subform on that. All data are entered on the datasheet.
 
projecttoday . . .

Yes! [blue]Unbound form[/blue] would be the way to go.

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
projecttoday . . .

And when you tried it?

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top