DLookUp only updates when i close the form

infantrie

New Member
Joined
Sep 9, 2009
Messages
33
I have a couple of DLookUps on a form and they only seem to update when i close the form! i suppose i could just enter the data and close the form for every entry, but i was hoping there was some fix i could put on the thing.

thanks
 

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Trevor G

Well-known Member
Joined
Jul 17, 2008
Messages
6,701
Office Version
  1. 2016
Platform
  1. Windows
From the field you are using behind in the properites look for either after update and then use a requery or refresh to the dlookup field
 

infantrie

New Member
Joined
Sep 9, 2009
Messages
33
Thanks very much. I've also now noticed that the data, whilst updating on the form is not actually making it into the table. I'm giving up. The gods must have been crazy to come up with this access thing. i'm going back to excel where humans are a natural part of the landscape. Thanks again for responding!
 

raj08536

Active Member
Joined
Aug 16, 2007
Messages
250
My understanding is that dlookup only bring data to form but not to update table.....

You need to use ADO or DAO.
 

strive4peace

Well-known Member
Joined
Jul 6, 2009
Messages
678

ADVERTISEMENT

" i'm going back to excel where humans are a natural part of the landscape"

oh don't give up on Access yet! You are right that many things are easier to do in Excel -- but here is where knowing when to use Excel and when to use Access is important.

If you change data and that causes the dLookups to get different values, you may just need to save the record to get them to refresh. On the AfterUpdate event of each of the source controls:

Code:
   Me.dirty =false
"dirty" is a form property that gets set to TRUE if a record has changes that need to be saved

if me.dirty then
is the same thing as
if me.dirty=True then

me.dirty = false

~~~~~~~~~~
if this doesn't do the trick, post the ControlSource for the controls that aren't getting the values updated
 

infantrie

New Member
Joined
Sep 9, 2009
Messages
33
thank you very much! funny thing though, when i changed the AfterUpdate event, my text was automatically changed from Me.Dirty=False to You.ShouldProbablyGiveUp,Jackass=True.

jk of course, but i wouldn't be surprised to see that at some point. i am going to try to implement that now. i really appreciate your time.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,491
Messages
5,596,474
Members
414,070
Latest member
DuncanLucas

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top