Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Event AFTER Domain Functions Have Resolved

Posted on 2011-02-23
8
Medium Priority
?
389 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 664 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 75

Assisted Solution

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

636 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