Refresh Dlookup Values on Several Tabs

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.
 
K

Ken Snell [MVP]

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.
 

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