Determine Whether a Nested Subform is Open (1 Viewer)

Elana

Registered User.
Local time
Today, 07:31
Joined
Apr 19, 2000
Messages
232
Hi

I'm trying to run some validation code and I want to be able to determine whether a subform is expanded before I let the user close the main form.

I've tried in the OnClose event of the main form: "if me.subdatasheetexpanded = true then...", but that's not working.

I don't want the user to be able to close the main form until he exits the subdatasheet, because on the Exit event of the subdatasheet, I have some validation code that runs to check his entries (usually there will be more than one entry in the subdatasheet and the entries in the subdatasheet need to add up to 100% to be valid).

I'm concerned that the user may just close the main form, in which case my validation code won't run, and it will cause an error because the validation code refers to the main form, which of course will be gone if the user has closed it.

Any ideas on how I can accomplish what I need to do? Any input is most appreciated.
 

Elana

Registered User.
Local time
Today, 07:31
Joined
Apr 19, 2000
Messages
232
Oops - thought I had this figured out, then realized I haven't yet. Wish I could delete my post, but no luck there.

[This message has been edited by Elana (edited 05-01-2002).]
 

Users who are viewing this thread

Top Bottom