473,394 Members | 1,726 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,394 software developers and data experts.

flaky events in A97

MLH
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
then open into design view from code
then set its visible propery to false
then open into design view from code
then set its visible propery to false
then open into design view from code
..... over and over and over

Activate event fires EVERY time.

However, if form is NOT first opened in
design view... if, instead, it is closed and
not opened at all and you do everything
else as above described - Activate Event
NEVER fires.

Is Access 97 broke, my computer broke or
am I broke?
Nov 13 '05 #1
9 1481
MLH <CR**@NorthState.net> wrote in
news:bh********************************@4ax.com:
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
then open into design view from code
then set its visible propery to false
then open into design view from code
then set its visible propery to false
then open into design view from code
.... over and over and over

Activate event fires EVERY time.

However, if form is NOT first opened in
design view... if, instead, it is closed and
not opened at all and you do everything
else as above described - Activate Event
NEVER fires.

Is Access 97 broke, my computer broke or
am I broke?


I don't understand.

What does design view have to do with it?

Why are you opening it in design view?

I can't replicate any of what I understand you to be saying.

Indeed, I found that opening a form with acHidden even causes the
Activate event to fire (to my surprise).

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #2
David W. Fenton wrote:
I don't understand.

What does design view have to do with it?


I've noticed in a difference on mine (A2K2), opening from design mode
causes the form footer to disappear. No biggie, esp. fop clients as they
won't do that but a bit of a pain when debugging something and I want to
see something in the footer.

--
[OO=00=OO]
Nov 13 '05 #3
MLH
David, I swear, I hate to put stuff on this forum that
might mislead everyone, causing them to look into
something that I've misinterpreted as a problem -
But honest to God, this is really what is happening.

As you can probably deduce from a couple of earlier
posts, I was wanting to handle a couple of things
during the activate event and I seemed to have
some flaky events. So I started testing various
scenarios. The design view thing, as you suspected,
has nothing to do with the application. I just discovered
the anomoly during testing. Here IS what is happening...

I open a form this way...
ThisForm = Me.Name
DoCmd.OpenForm "frmVehicleChooserForm", , , , , acDialog, ThisForm
Notice the 6th parm is acDialog.

FACT: If that form is NOT open in any view, the Activate event does
NOT fire. If that form is ALREADY open in design view, its Activate
event DOES fire. For me, this has happened at least a dozen times
straight over the past 48 hours. It has NOT varied in its behavior. I
have noticed that the acDialog parm seems to affect this. Removing
it from the equation, Activate event seems to fire every time in all
cases.
Nov 13 '05 #4
MLH wrote:
I
have noticed that the acDialog parm seems to affect this. Removing
it from the equation, Activate event seems to fire every time in all
cases.


acDialog avoids the activate event. However, since you're opening from
design view, then the act of opening from design view will negate the
acdialog parameter. I found this to be the case in A97 and A2003.

What you have to do when developing a form that is opened with the
acDialog parameter is to first close it.

But then, if you don't want the on activate event to fire, why on earth
do you have anything there????
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #5
MLH
The activate event is supposed to fire whether I want it to or not.
I want it to do that. Problem is exactly that - it is not firing when
I was hoping it would. I guess acDialog is to blame. That leaves
me no choice but to do away with the acDialog parm.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

acDialog avoids the activate event. However, since you're opening from
design view, then the act of opening from design view will negate the
acdialog parameter. I found this to be the case in A97 and A2003.

What you have to do when developing a form that is opened with the
acDialog parameter is to first close it.

But then, if you don't want the on activate event to fire, why on earth
do you have anything there????


Nov 13 '05 #6
Bri

MLH wrote:
The activate event is supposed to fire whether I want it to or not.
I want it to do that. Problem is exactly that - it is not firing when
I was hoping it would. I guess acDialog is to blame. That leaves
me no choice but to do away with the acDialog parm.


On Load?
On Open?

Would one of these events be the place for your code?

--
Bri
Nov 13 '05 #7
MLH wrote:
The activate event is supposed to fire whether I want it to or not.
I want it to do that. Problem is exactly that - it is not firing when
I was hoping it would. I guess acDialog is to blame. That leaves
me no choice but to do away with the acDialog parm.


Did you try setting the form to modal and pop up? I'm not 100% off the
top of my head if this will work or not, but I do know it will give the
same appearance as opening it in acdialog and will allow you to perform
code after the docmd.open rather than the rather complicated approach
you've suggested in another post.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #8
MLH <CR**@NorthState.net> wrote in
news:um********************************@4ax.com:
David, I swear, I hate to put stuff on this forum that
might mislead everyone, causing them to look into
something that I've misinterpreted as a problem -
But honest to God, this is really what is happening.
I really do feel your pain! It's just that I couldn't reproduce your
problems.
As you can probably deduce from a couple of earlier
posts, I was wanting to handle a couple of things
during the activate event and I seemed to have
some flaky events. So I started testing various
scenarios. The design view thing, as you suspected,
has nothing to do with the application. I just discovered
the anomoly during testing. Here IS what is happening...

I open a form this way...
ThisForm = Me.Name
DoCmd.OpenForm "frmVehicleChooserForm", , , , , acDialog, ThisForm
Notice the 6th parm is acDialog.
Well, let me tell you -- I'm discovering some weird things, too. I'm
using A97, like you (if I'm remembering correctly).

I have an app that opens to heavyweight forms hidden when the main
switchboard screen opens. The if I put MsgBox "Activate" in the
OnActivate event of one of those forms, it first when the form is
open with acHidden, which actually surprises me.

The other surprise is that it activates for my Close button (which
sets Me.Visible = False).

Then, the other weird thing is when I then unhide the form (with the
switchboard, which is issueing a DoCmd.OpenForm), the Activate event
does *not* fire!

I tried moving the event to OnGotFocus, but the form itself doesn't
appear to be *getting* the focus, so it never fires!

Now, testing your scenario with acDialog, I see exactly the same
thing.
FACT: If that form is NOT open in any view, the Activate event
does NOT fire. If that form is ALREADY open in design view, its
Activate event DOES fire. For me, this has happened at least a
dozen times straight over the past 48 hours. It has NOT varied in
its behavior. I have noticed that the acDialog parm seems to
affect this. Removing it from the equation, Activate event seems
to fire every time in all cases.


Well, as I said in another message, I think you have a flaw in your
design. No, I can't explain why OnActivate is not working the way
I'd think it would, but you can easily re-engineer your form to make
it a non-issue.

Assuming that your dialog form's CLOSE button is setting Me.Visible
= False, and then code somewhere else is pulling values out of that
form's controls (or the global variables), at that point you ought
to be able to then re-initialize your global variables.

I don't like using global variables for passing information between
forms, myself. I would tend to use a class module an instance of
which I could destroy and recreate at will. I would also tend, then,
to make the opening of the form part of the class module, so that
the method of the class that opens the form would make sure the
class module was appropriately initialized.

There are other ways to avoid depending on OnActivate that I've
outlined in other replies. If you didn't see those, I'll let you
know the Google URLs for them.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #9
Bri <no*@here.com> wrote in news:7O8Ee.12890$s54.11245@pd7tw2no:

MLH wrote:
The activate event is supposed to fire whether I want it to or
not. I want it to do that. Problem is exactly that - it is not
firing when I was hoping it would. I guess acDialog is to blame.
That leaves me no choice but to do away with the acDialog parm.


On Load?
On Open?

Would one of these events be the place for your code?


Geez, people -- read back in the thread.

He has a form and this form is sometimes open but hidden.

He wants the initialization code to run each time the form is opened
or made visible. So, OnLoad/OnOpen will work if the form isn't already
open, but it won't accomplish anything then the form is open and
hidden. The Activate event is the obvious place for it, but OnActivate
doesn't fire for form's opened as dialogs, so that won't work.

The only solution is to re-engineer the initialization so that it
doesn't happen in the dialog form's code.

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

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Vince C. | last post by:
Hi. I'd like to trap ADO Recordset object events in my ASP script (either VBS or JS, no preference). I've tried (in VBS) writing a Sub rs_RecordChangeComplete( adReason, cRecords, pError,...
3
by: Sasha | last post by:
Hi everyone, Here is my problem: I have the following classes: - DataNode - this class is designed to hold some data and will be contained in a tree like data structure DataTree. When...
14
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using...
4
by: LP | last post by:
Hello! I am still transitioning from VB.NET to C#. I undertand the basic concepts of Delegates, more so of Events and somewhat understand AsyncCallback methods. But I need some clarification on...
0
by: Shock | last post by:
Hello all, I work for a small programming shop and we have recently been developing web reports using aspx datagrids. On productions machines everything works fine, but when we move the content...
6
by: Shock | last post by:
Hello all, I made a post yesterday about the flakiness of asp.net datagrids. I was under the impression that this problem was only in regard to datagrids. Apparently our problems are with any...
11
by: Nicky Smith | last post by:
Hello, I'm studying a book on VB.net Win apps, and I'm reading a section on events and delegates and raising events. Is it just me, or is this not just subs dressed up as something else? I...
14
by: xoozlez | last post by:
Hi there, I have a registration form where I like to filter out the past events of 2007. This is the code I am using : strSQL = "SELECT EventID, EventName, EventDateBegin, EventDateEnd,...
1
by: swethak | last post by:
Hi, I am desiging the calendar application for that purpose i used the below code. But it is for only displys calendar. And also i want to add the events to calendar. In that code displys the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.