Solved

Event AFTER Domain Functions Have Resolved

Posted on 2011-02-23
8
381 Views
Last Modified: 2013-11-28
I've added some DLookups to a form and they're wreaking havoc on some of my objects in memory (collections being destroyed, etc.) that are created On_Load.  If I initialize all these objects AFTER the DLookups have resolved there should be no problem.  I've tested this by running the code with a button after I see the DLookup values populated.  Is there a form event that fires when all these functions have resolved?  OnLoad and OnCurrent run before they have resolved.

Mike
0
Comment
Question by:shacho
8 Comments
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 166 total points
ID: 34966986
from access help, type   responding to events

look at Order of events for database objects

hope this help for whatever you are trying to do
0
 
LVL 75
ID: 34967104
Where exactly are these DLookups() ?
What event occurs after they run depends on where they are executing.
DLookups() within themselves are not going to do anything to any other code.

mx
0
 

Author Comment

by:shacho
ID: 34967141
>Where exactly are these DLookups() ?
As Control Sources on unbound textboxes.

>DLookups() within themselves are not going to do anything to any other code.
You're right - they shouldn't.  But something goes haywire when they resolve.  You may recall I was working on storing references to textboxes in a collection in order to monitor double-click events.  As soon at I put these DLookups on my form, the collection vanishes from memory after one double-click event is trapped.  Poof - it suddenly equals "Nothing".  If I remove the DLookups, everything works fine.  The DLookups themselves also resolve just fine.  I've already worked around it by running the DLookups once on Load in the code and setting the textbox values directly, i.e. there are no "live" DLookups on the form.  Now things are fine again.  Would love to know why, though.

Mike

0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 167 total points
ID: 34967156
I just downloaded that db ... will check it out in a bit ...

Technically ... DLookups() in a Control Source are then calculated values ... causing the Form to do automatic ReCalcs I suppose ... in case that matters.

mx
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 167 total points
ID: 34970175
I don't think there IS an Event you can trap that will do this, at least not reliably. Can you modify your approach such that you use Recordsets and such in the Form's Current event to load those unbound controls? Or perhaps a Class that can manage this, and then expose the values through Properties?

If you do something like that, you have full control over what is occurring, and can react to the logic/data processing exactly when needed.
0
 

Accepted Solution

by:
shacho earned 0 total points
ID: 34970288
>Can you modify your approach
Yes - I've already worked around the problem with a similar approach to what you've suggested.  It's a lot cleaner and faster anyway.  I would still love to know why DLookups cause this funky unstable behavior.  Just 'cause I'm curious.  I spend a decent amount of time coding around unexpected behavior in Access on any given complex project.  Some peripheral knowledge of what causes these sorts of problems makes it that much easier to troubleshoot or avoid in the first place.  I'm sure you can relate.

Mike
0
 
LVL 75
ID: 34972402
"I'm sure you can relate."
Yes.
0
 

Author Closing Comment

by:shacho
ID: 35042375
Just a mysterious bug.
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now