Dlookup need refresh

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
 
K

Ken Snell

In the AfterUpdate event of the part number textbox, use code similar to
this:

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

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

Similar Threads


Top