Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > On Activate < Force New Page | Activate v Got Focus >
Back to On Activate    Comments List
Pinned    Upload Images   Link   Email  
Doesn't Always Work
Thomas Gonder 
       
2 years ago
It works fine for simple forms that may be called from a menu, but if you open forms with acdialog using VBA code, you will find that the Form_Activate and Form_Deactivate don't always run. A good thing to experiment before you dedicate a Sunday to changing your forms.
Thomas Gonder OP 
       
2 years ago

Thomas Gonder OP 
       
2 years ago
In the above image, the Entity Form opened the Entity Search Form via a standardized procedure in a form helper module, but the Deactivate procedure didn't run. Likewise, when the Entity Search form opened, the Activate didn't run there.  Hence, a user might think the Entity Form is active, when in fact the Entity Search Form is active.

The yellow status boxes in my forms show the procedures that ran. Notice the Activate didn't run in the Entity Search Form.

Commenting out the acDialog made no difference.
I went so far as to put breakpoints in the procedures for Activate and Deactivate to confirm they weren't running. As I'll show in the next image, the Entity Forms works fine when the menu program goes active.
Richard Rost 
           
2 years ago
Thanks for sharing. You are absolutely correct. If a form's PopUp property is set to true, then the Activate and Deactivate events do not run. For me, this is never a problem because I absolutely hate the PopUp property and never use it. If you open a form using acDialog, that essentially sets the Modal and PopUp properties to true. Thanks for bringing this up, and I'll make a note on the video page.
Thomas Gonder OP 
       
2 years ago

Thomas Gonder OP 
       
2 years ago
The above image (I can't seem to get them on the same post--dummy me!) shows the colors properly when using just the Menu and Entity Form. The form helper module seems to confuse Access, not running the Activate procedures.  I'm going to move the actual Activate procedures to the form helper module (I think Richard called the helper module a global module/procedure) and then try using the helper procedures when opening form from the helper module. Hang tight, I'll be back with an image if it works (which may take some time, as usual, to work around the Access quirks).

Generally, I too don't like modal/popup forms, but there are times where the user can shoot themselves in the foot if they start clicking between forms and not finish one first.
Thomas Gonder OP 
       
2 years ago
After a little testing, the header portion of a form now changes color based on its being active or not.
A few notes about the example beyond just the activate colors:
You can see record locking (Richard can put the proper tutorial link here)
The colors are based on the color tutorial and using shades and complementary colors (Richard can put the proper tutorial link here)
A Search form of Entities is based on the Search tutorial (Richard can put the proper tutorial link here)

"Of what is this "helper module" you speak of?", you may ask. Richard provides the basics of how to do something in a form. But if you want that feature available to all your forms (rather than coding each feature in each form) then you need a module underneath the class module (the one that is linked directly to the form and which Richard uses in his tutorial) for all the routines. That way, with any luck, you write the procedure just once and use its benefits everywhere. In the locked record above, there is a helper procedure that is called by the form class module, and this helper module calls yet another procedure in another module to do the actual locking. Each level passing along the parameters that are needed. Why three procedures? All locking isn't done by forms, you may have a big update program that needs to lock a table as it runs, in which case it's not directly form related, yet it can still lock a table or record for the entire application.
Thomas Gonder OP 
       
2 years ago

Thomas Gonder OP 
       
2 years ago
When I started writing business applications in the 1970s, we had dumb terminals hooked to a mainframe or mini-computer.  These dumb terminals displayed one color on a black background, maybe you had bold or italic text, and maybe reversed text (black characters on a white background). There wasn't a way to pop a "window" onto the display. Personal PCs were just arriving, with the IBM PC years away, and colors and Windows even further out on the timeline.

It's a dream to be able to communicate with the user using colors rather than lots of message boxes that clutter things up and disrupt data entry. For example, the red background in the Entity Form immediately screams out "Problem!". The record is locked.

The turquoise color of the Entity Search Form's header communicates "You're working here".

The red color for the command buttons in the Related Box says "Don't even try"

The yellow textboxes in the Entity form tells you that you are previewing the record, not entering.
The olive-green textbox in the Entity Relationships Form says, "you are editing and entering data here" (once the form gets focus again).

When the Entity Relationship form goes dirty, the Exit command button at the bottom turns yellow and is enabled.

Etc.

Life is pretty good as a programmer now. ChatGPT is not going to replace all the hard work that it takes to make an application professional looking.
Richard Rost 
           
2 years ago
I agree. AI is good for a lot of things, but it's got a long way to go before it's going to be better at making user interfaces than humans can.
Thomas Gonder OP 
       
2 years ago
I asked ChatGPT if Fred Flintstone watched television and used the telephone. It said "no", with a lot of other text explaining why.
It's been a few years, but I was sure I had seen it in the cartoon.

I also tried a "female friend" AI program out of curiosity a few weeks back. After the initial setup, I asked the AI female how her relations were with her parents (with the best of intentions). "She" told me she likes having sexual relations with her parents.

As a programmer/designer, I'm not too worried about being replaced.
Thomas Gonder OP 
       
2 years ago

Thomas Gonder OP 
       
2 years ago
To be fair to ChatGPT, I do remember that The Flintstones used animals to replicate modern appliances, like the bird that serves as a record player, or the pig like creature under the sink that was the garbage disposal. It's possible that the TV scene I imagined is apocryphal, created outside the actual cartoon episodes of Hanna-Barbera.

I stand by the observation of the AI virtual "girlfriend".

If The Flinstones are too ancient history for you, I'll give a different example in the following image.
Thomas Gonder OP 
       
2 years ago

This thread is now CLOSED. If you wish to comment, start a NEW discussion in On Activate.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 2/15/2025 2:08:42 PM. PLT: 1s