By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,578 Members | 825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,578 IT Pros & Developers. It's quick & easy.

A97's Activate event - reasons why it does not occur after opening a form?

P: n/a
MLH
Say I open a form (MyForm) in design view, then I close it and
dbl-click it in the database window to open it. Shouldn't the Activate
event occur in all such situations? What might the case(s) be if the
Activate event does NOT fire?
Nov 13 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
MLH
And what about opening that same form from code - should the
Activate event fire then too?
Nov 13 '05 #2

P: n/a
MLH <CR**@NorthState.net> wrote in
news:ap********************************@4ax.com:
And what about opening that same form from code - should the
Activate event fire then too?


I just ran some tests. Activate is firing in all cases.

How are you testing?

How did you insert the code?

Is it possible that the Active event's code has somehow become
disconnected from the form? Try copying the contents of the Activate
event in code, then delete the entire event, and go back to the form
and recreate it.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #3

P: n/a
Not sure what's going on with your code, but when I open or switch to
(tab to) an already open form with code in the OnActivate event of the
form, it fires just fine. Of course, it won't fire if you don't open
it in Normal mode (ie if you are opening it in design mode, none of
the events fire).

Nov 13 '05 #4

P: n/a
David W. Fenton wrote:
MLH <CR**@NorthState.net> wrote in
news:ap********************************@4ax.com:

And what about opening that same form from code - should the
Activate event fire then too?

I just ran some tests. Activate is firing in all cases.

How are you testing?

How did you insert the code?

Is it possible that the Active event's code has somehow become
disconnected from the form? Try copying the contents of the Activate
event in code, then delete the entire event, and go back to the form
and recreate it.


Good key combination in these cases is (in VBA window):

Ctrl+A (select all), Ctrl+X (cut), Ctrl+V (paste)

That will re-connect all event procedures.

Well, that is it will in this century's versions of Access, dunno about
the erstwhile ones :-)

--
[OO=00=OO]
Nov 13 '05 #5

P: n/a
On Thu, 21 Jul 2005 19:30:18 +0100, Trevor Best <no****@besty.org.uk>
wrote:
Is it possible that the Active event's code has somehow become
disconnected from the form? Try copying the contents of the Activate
event in code, then delete the entire event, and go back to the form
and recreate it.


Good key combination in these cases is (in VBA window):

Ctrl+A (select all), Ctrl+X (cut), Ctrl+V (paste)

That will re-connect all event procedures.

Well, that is it will in this century's versions of Access, dunno about
the erstwhile ones :-)


I have seen occasions where if the form's module is corrupted, simply
cutting and pasting alone does not remove the corruption.

I generally -

Ctrl+A (select all), Ctrl+X (cut)
On the form's property sheet set HasModule to No (completely remove
current module)
Save the form
Open the form's module (will now be a new module)
Delete the declarations from the top of the module (so they are not
duplicated after pasting)
Ctrl+V (paste)
Nov 13 '05 #6

P: n/a
Trevor Best <no****@besty.org.uk> wrote in
news:42***********************@news.zen.co.uk:
David W. Fenton wrote:
MLH <CR**@NorthState.net> wrote in
news:ap********************************@4ax.com:

And what about opening that same form from code - should the
Activate event fire then too?

I just ran some tests. Activate is firing in all cases.

How are you testing?

How did you insert the code?

Is it possible that the Active event's code has somehow become
disconnected from the form? Try copying the contents of the
Activate event in code, then delete the entire event, and go back
to the form and recreate it.


Good key combination in these cases is (in VBA window):

Ctrl+A (select all), Ctrl+X (cut), Ctrl+V (paste)

That will re-connect all event procedures.

Well, that is it will in this century's versions of Access, dunno
about the erstwhile ones :-)


Um, do you mean in Access 2002 and Access 2003, since the year 2000
was the last one of the 20th century?

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #7

P: n/a
Wayne Gillespie <be*****@NOhotmailSPAM.com.au> wrote in
news:d3********************************@4ax.com:
On Thu, 21 Jul 2005 19:30:18 +0100, Trevor Best
<no****@besty.org.uk> wrote:
Is it possible that the Active event's code has somehow become
disconnected from the form? Try copying the contents of the
Activate event in code, then delete the entire event, and go
back to the form and recreate it.


Good key combination in these cases is (in VBA window):

Ctrl+A (select all), Ctrl+X (cut), Ctrl+V (paste)

That will re-connect all event procedures.

Well, that is it will in this century's versions of Access, dunno
about the erstwhile ones :-)


I have seen occasions where if the form's module is corrupted,
simply cutting and pasting alone does not remove the corruption.


Er, who was talking about code corruption? I was talking about the
loss of the connection between the object and it's events in code.
Sometimes you can see [EVENT PROCEDURE] in an object's properties
sheet, but the event doesn't fire, and the only solution I've found
is recreating it from scratch, via the property sheet UI.
--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #8

P: n/a
"David W. Fenton" wrote
Um, do you mean in Access 2002 and
Access 2003, since the year 2000
was the last one of the 20th century?


Picky, picky, picky!

Despite the "actual definition", when the leftmost digit rolls, most of the
world views it as "the new millennium" -- the cruise line must have, as the
cruise I took as a Millennium cruise encompassed January 1, 2000, not
January 1, 2001. I figured if the ship's computer suffered Y2K freak-out,
there'd likely be enough food until we drifted to one or the other shores of
the Caribbean.
Nov 13 '05 #9

P: n/a
David W. Fenton wrote:

Well, that is it will in this century's versions of Access, dunno
about the erstwhile ones :-)

Um, do you mean in Access 2002 and Access 2003, since the year 2000
was the last one of the 20th century?


Would the semantics matter anyway as A2K came out in '99? Let's just say
the versions supported by MS this century.

I'm talking A2K onwards where the VBA model changed to use the separate
code window. I've never tried that method in earlier versions.

--
[OO=00=OO]
Nov 13 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.