Refresh Dlookup Values on Several Tabs

  • Thread starter Thread starter cp2599
  • Start date Start date
C

cp2599

I have a multi-tabbed form of which several attributes are populated
with the DLookup command on other tabs during the Load process.
Refresh and Requery doesn't seem to work with DLookup. Is there a way
refresh (re-load) the values in a DLookup field without doing another
DLookup? If the answer is no, my next question is where's the best
place to put the Dlookup commands so that they refresh when I switch
from tab to tab. There seems to be only one tab object that I can add
code to and not all attributes used in the Dlookup are defined when I
place the code for all tabs in that object. I'd really appreciate any
help you can give me.
 
Assuming that you're using the DLookup function in an expression as the
ControlSource of a textbox, just requery that textbox:

Me.NameOfTextBox.Requery

You can run the code above by using the Change event of the tab control, and
use the Value of the tab control to identify which textboxes need to be
requeried.
 
Back
Top