473,769 Members | 2,348 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1495
MLH <CR**@NorthStat e.net> wrote in
news:bh******** *************** *********@4ax.c om:
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 "frmVehicleChoo serForm", , , , , 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.

xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx x

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**@NorthStat e.net> wrote in
news:um******** *************** *********@4ax.c om:
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 "frmVehicleChoo serForm", , , , , 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.1289 0$s54.11245@pd7 tw2no:

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
3077
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, adStatus, pRecordset ) - rs being a server-side ADODB.Recordset object - but it doesn't get called whenever rs is moved (I browse it in a loop). Is there a way to catch those events from ASP?
3
2038
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 DataNode is changed, it raises "Changed" event. The class has a reference to the DataNode it is being contained in: - DataTree - tree like data structure that contains DataNodes; When
14
12148
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 events since I never saw it used anywhere in MSDN documentation/samples?! Or it will just break when I upgrade to .NET Framework 2.x in the coming years namespace MyNamespac public delegate void MyDel() public class MyBase public virtual...
4
22886
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 when to use one over another? If anyone could provide any additional info, your comments, best practices, any good articles, specific examples, etc. Thank you
0
965
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 out to the web server it becomes very flaky. The problem is around the datagrid itself. The paging features seem very flaky. Sometimes the pages load correctly when the numbers in the footer are clicked on and sometimes they don't. No error...
6
1090
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 aspx page. At random these pages do not want to load, but this only happens once the projects have been deployed, it doesn't happen on development machines. Pages will come up blank and the source will appear cut off and at times pages will...
11
1884
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 mean, for one, delegates point to subs, so when you call a delegate, why not just call the sub dierectly and not bother adding the extra code involved adding the delegate?
14
2220
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, EventTimeBegin, Category FROM Events WHERE EventDateBegin >'01/01/2008' AND Events.Category LIKE '3' OR Events.Category LIKE '4' OR Events.Category LIKE '5' OR Events.Category LIKE '6' OR Events.Category LIKE '7' OR Events.Category LIKE '8' OR...
1
4908
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 events when click on that date that perticular event displyed in a text box.But my requirement is to when click on that date that related event displyed in same td row not the text box. and also i add the events to that calendar.plz advice how to...
0
10043
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9861
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3956
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.