Cause a DLookup formula to update using VBA

X

xp

I have a form with a DLookup formula in the "Control Source" of a text box.
This runs fine when the form loads.

After the users run an update, I want to trigger the DLookup formula to
refresh itself from a code module so the form will display current
information. I tried something like:

Forms("MyForm").Controls("MyControl").Refresh

But this fails, can anyone please help me out on this?

Thanks!
 
J

John Spencer MVP

I would try using the recalc method in the form's current event.
Me.Recalc
or if you are doing this outside the form's events then
Forms("MyForm").Recalc


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top