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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cancel closing of a subform at mainform unload

Status
Not open for further replies.

JennieL

Technical User
May 16, 2005
19
CA
Hi:

I have a main form with a subform. I am trying to cancel closing where user left a null value on subform.

Works fine if I test with main form only, but when I try cancel = true at onunload on main form with subform, I can't get closing to stop.

It seems as though subform is closing before event can view for nulls.

Does anyone know of a way to cancel closing of subform from main form?

Thank you.
 
How are ya JennieL . . .

Forms open the inner most subform out to the parent. [blue]The order is reversed when closing.[/blue] So using the mainform [blue]Unload[/blue] event is correct.

Are you sure your referencing the subform control correctly?
Code:
[blue] If Trim([purple][subFormName].Form!ControlName[/purple] & "") = "" Then Cancel = True[/blue]

Calvin.gif
See Ya! . . . . . .
 
Hey AceMan:

I will give that a try. Thanks for your help.

JennieL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top