Solved

Event AFTER Domain Functions Have Resolved

Posted on 2011-02-23
8
387 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) 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
 
LVL 85

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

690 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