Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLookup Refresh

Status
Not open for further replies.

acnovice

Programmer
Jan 27, 2005
100
US
Hi,

Is there any way to refresh DLookup function in my subform ?

I have a main form(frmQchart) with a sub-form(sfrmSIsummary) with datasheet format and I'm using DLookup to bring up few fields (fob1,fob2,,,) from tblFOB.

Once I brought up the fields from sfrmSIsummary and change the data in fob1 & 2 later from tblFOB, they don't refresh the fields at all but main form refreshes my sub-form whenever I press the refresh button.

I want them refresh the DLookup fields automatically.
Following is one of my DLookup.
Code:
Me![fob1] = DLookup("fob1", "tblFOB", "[ShopPN]='" & Me![ShopPN] & "'")
Any help will be appreciated.
 
GingerR,

I tried yours but it doesn't change anything at all.

Thank you.
 
Me![subform].Requery

Never give up never give in.

There are no short cuts to anything worth doing :)
 
I don't believe DLookup refreshes on a form requery. It is a function that needs to be re-executed to perform the lookup and retrieve operation.

DLookup and other "Domain functions" are very useful, but "expensive" to run.

In the past, I've done this kind of operation by placing the Dlookup code in a procedure, and calling the procedure on a form_CURRENT event or something similar.


Don't be sexist - Broads hate that.
 
WildHare,

You're right. I need a DLookup function to be re-executed not a form refreshing. I can put a code in On_Current event but one thing that I'm considering is "causing performance issues". If I can control the event refreshing interval, it would be nice.

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top