Form_Load

A

AEROTJK

Would anyone know why the code after my Private Sub() Form_Load does not get
executed? It seemed to all of a sudden happen? Other forms with the
Form_Load subroutine execute their code just fine.
Thank you for the time to read my question and thank you for your time to
respond.

Regards,
TJ Kenfield
 
A

Allen Browne

1. Open the form in design view, and make sure its On Load property is set
to:
[Event Procedure]
If that property is not set, the code won't run.

2. At the top of the procedure (immediately after the Private Sub Form_Load
line), temporarily add:
Debug.Print "Form_Load for "& Me.Name & " at " & Now()
Then after loading the form, open the Immediate Window (Ctrl+G) to see if it
did run.

If it still doesn't run, there is another issue here. May be security (no
code runs), corruption (decompile, turn off name autocorrupt,
compact/repair, etc).
 
A

AEROTJK

Yeah, the form has the [Event Procedure] and the result of the debug did not
print to the immediate window. Would you be able to expand option 3 further
for things I can try.

Basically I have a "main" form with a combo box of options. 2 of the
options execute their code in the load subroutine just fine. However when
the 3rd option is selected the open form command is executed however the load
sub routine code isn't even touched.

Thanks again for your insight.

Allen Browne said:
1. Open the form in design view, and make sure its On Load property is set
to:
[Event Procedure]
If that property is not set, the code won't run.

2. At the top of the procedure (immediately after the Private Sub Form_Load
line), temporarily add:
Debug.Print "Form_Load for "& Me.Name & " at " & Now()
Then after loading the form, open the Immediate Window (Ctrl+G) to see if it
did run.

If it still doesn't run, there is another issue here. May be security (no
code runs), corruption (decompile, turn off name autocorrupt,
compact/repair, etc).

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

AEROTJK said:
Would anyone know why the code after my Private Sub() Form_Load does
not get executed? It seemed to all of a sudden happen? Other forms with
the Form_Load subroutine execute their code just fine.
Thank you for the time to read my question and thank you for your time to
respond.

Regards,
TJ Kenfield
 
A

Allen Browne

If this is Access 2007, the code does not run unless you trust the folder.
Steps in the yellow box at the(top right of this page:
http://allenbrowne.com/Access2007.html

If that's not it, follow through the steps of this recovery sequence:
http://allenbrowne.com/recover.html
That explains the decompile, ensuring references are valid, and so on. That
should do it.

Post back if you are still stuck, even after the final
SaveAsText/LoadFromText solution.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

AEROTJK said:
Yeah, the form has the [Event Procedure] and the result of the debug did
not
print to the immediate window. Would you be able to expand option 3
further
for things I can try.

Basically I have a "main" form with a combo box of options. 2 of the
options execute their code in the load subroutine just fine. However when
the 3rd option is selected the open form command is executed however the
load
sub routine code isn't even touched.

Thanks again for your insight.

Allen Browne said:
1. Open the form in design view, and make sure its On Load property is
set
to:
[Event Procedure]
If that property is not set, the code won't run.

2. At the top of the procedure (immediately after the Private Sub
Form_Load
line), temporarily add:
Debug.Print "Form_Load for "& Me.Name & " at " & Now()
Then after loading the form, open the Immediate Window (Ctrl+G) to see if
it
did run.

If it still doesn't run, there is another issue here. May be security (no
code runs), corruption (decompile, turn off name autocorrupt,
compact/repair, etc).

AEROTJK said:
Would anyone know why the code after my Private Sub() Form_Load does
not get executed? It seemed to all of a sudden happen? Other forms
with
the Form_Load subroutine execute their code just fine.
Thank you for the time to read my question and thank you for your time
to
respond
 
A

AEROTJK

Is genius used to describe you at all.

I had my array declared as private and when I compiled, it yelled at me.
It's now public and the form loaded flawlessly. Thank you for your wonderful
expertise!!

TJ Kenfield

Allen Browne said:
If this is Access 2007, the code does not run unless you trust the folder.
Steps in the yellow box at the(top right of this page:
http://allenbrowne.com/Access2007.html

If that's not it, follow through the steps of this recovery sequence:
http://allenbrowne.com/recover.html
That explains the decompile, ensuring references are valid, and so on. That
should do it.

Post back if you are still stuck, even after the final
SaveAsText/LoadFromText solution.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

AEROTJK said:
Yeah, the form has the [Event Procedure] and the result of the debug did
not
print to the immediate window. Would you be able to expand option 3
further
for things I can try.

Basically I have a "main" form with a combo box of options. 2 of the
options execute their code in the load subroutine just fine. However when
the 3rd option is selected the open form command is executed however the
load
sub routine code isn't even touched.

Thanks again for your insight.

Allen Browne said:
1. Open the form in design view, and make sure its On Load property is
set
to:
[Event Procedure]
If that property is not set, the code won't run.

2. At the top of the procedure (immediately after the Private Sub
Form_Load
line), temporarily add:
Debug.Print "Form_Load for "& Me.Name & " at " & Now()
Then after loading the form, open the Immediate Window (Ctrl+G) to see if
it
did run.

If it still doesn't run, there is another issue here. May be security (no
code runs), corruption (decompile, turn off name autocorrupt,
compact/repair, etc).

Would anyone know why the code after my Private Sub() Form_Load does
not get executed? It seemed to all of a sudden happen? Other forms
with
the Form_Load subroutine execute their code just fine.
Thank you for the time to read my question and thank you for your time
to
respond
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top