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!

Order of Execution

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
Can someone please explain the order of execution and the differences between OnCreate, OnActivate and OnIntialize. I realize that OnCreate happens when the application starts, but the others I can't quite grasp the differences.

Thanks! Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
OnActivate occurs whenever you switch to the form. What is OnInitialize an event of?
 
I guess it's actually FormIntialize. Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
No I'm not sure! I swear it was there somewhere! Anyway, here's the real problem I'm trying to solve. When my program first opens I want to check if a process has already occurred (I check the database to see if a specific field is marked 'Y'). If the process has already occurred, I need to check a specific directory to see if files exists. If the files exist then a messagebox informs the users that the documents need to be printed. But I don't want it to happen each time the main form is activated. So I tried the FormCreate, except since I have to run a query I get 'Access Violation error'. So I need a procedure that will only run the first time the form is opened for a users. Any suggestions?

THANKS!! Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
You can do this using the forms oncreate procedure. The problem your encountering is probably due to the creation order of your forms. For example, if you perform the check in form1's oncreate procedure, and you are referencing something from say form3, then form 3 has not yet been created so an error is thrown up. Goto Project and View Source to see what order your forms are being created in. Arte Et Labore
 
Thanks, I just tried moving things around to see if that would solve it. Nice to know that occasionally I have a clue!

Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top