473,326 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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

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
9 2532
MLH
And what about opening that same form from code - should the
Activate event fire then too?
Nov 13 '05 #2
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
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
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
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
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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Bradley | last post by:
Has anyone else noticed this problem? I converted the back-end to A2000 and the performance problem was fixed. We supply a 97 and 2000 version of our software so we kept the backend in A97 to make...
2
by: Randy Harris | last post by:
I'm working with Access 2K and seem to be getting some behavior that contradicts the documentation. First, the help says: "Note The Activate event doesn't occur when a form receives focus back...
6
by: MLH | last post by:
Did A97, perchance, do away with the need for an AutoExec macro to initiate an autoexec sequence for databases? Or, must we still suffer with that hideous macro?
9
by: MLH | last post by:
open form in design view then allow it to be opened into form view from code. then set its visible propery to false then open into design view from code then set its visible propery to false...
3
by: active | last post by:
I remember when I checked NewGroups for comments about the VB6 Activate event and found that many thought it was not a reliable way to keep track of which form has focus. There was enough bad press...
5
by: juststarter | last post by:
hi there here is my problem : there is a main form (frmMain) which calls a searchForm (frmSearch). Then i select an item (from the returned ones) and open a third form (frmData). Taking from...
3
by: David W. Fenton | last post by:
I ran into a weird problem with a subreport with an OnFormat event of the subreport detail. When I view the field list in report design view, all the aliased fields in the recordsource are...
0
MMcCarthy
by: MMcCarthy | last post by:
VBA is described as an Event driven programming language. What is meant by this? Access, like most Windows programs, is an event driven application. This means that nothing happens unless it is...
3
by: Salad | last post by:
Using A97, SP2, most current jet35. I have a search form. The op enters an id to search/find. If found, a data entry form is presented for that id. This form has 7 or 8 combos, a bunch of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.