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

Which Event should I use?

Status
Not open for further replies.

gizzu

Programmer
May 20, 2005
8
A2
Form1 has a sub form, Form2, which have a tab control with a number of tabs. One of them, Tab4, includes a sub form, Form3.

I have an SQL statement that I want to run (using DoCmd.RunSQL) when Form3 is shown on screen the first time, e.g. when Tab4 activates. I've tried OnClick for Tab4, OnActivate for both Form3 and Tab4 along with a dozen other events with no result. Maybe the problem is that the tab control is also in a subform?

Any suggestions?
 
How are ya gizzu . . . . .
[blue]I have an [purple]SQL statement that I want to run[/purple] (using DoCmd.RunSQL) [purple]when Form3 is shown on screen the first time[/purple], e.g. when Tab4 activates.[/blue]
That depends . . . . If the SQL [blue]is independent[/blue] (not dependent on any form references in criteria), run it in the [blue]OnLoad[/blue] event of [blue]Form3[/blue].

If the SQL is [blue]dependent on form references[/blue], identify the forms in your next post.

Calvin.gif
See Ya! . . . . . .
 
I was able to solve the problem in the On_Change Event for the tab control in Form2. Sorry for posting, and thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top