Dlookup need refresh

  • Thread starter Thread starter G Lam
  • Start date Start date
G

G Lam

Hi, I added an unbound text box, ShowPrice, in a form. The form's data
source is a table tblInvDet. I set the datas ource for the ShowPrice box as
following:

=Dlookup("UnitPrice", "tblPriceList", "PartNbr = Me!SkuNbr")

The ShowPrice box only shows the user the price for that part number. When I
type in the part number, the unit price do not displayed. I need to click
Record->Refresh to force the unit price to show up. The form is a datasheet
form.

What should I do to make the unit price come up without clicking any thing?

Thank you.
Gary
 
In the AfterUpdate event of the part number textbox, use code similar to
this:

Private Sub PartNbr_AfterUpdate()
Me.ShowPrice.Requery
End Sub
 
Back
Top