Vlookup problem

N

nybaseball22

Hello. I am using a vlookup in a text box. The string looks up info
from a table based on a selection or the information already contained
in a combo box. The problem is, if I make a change to the information
in the combo box, the vlookup does not update. Could this be due to
code I have running in the AfterUpdate of my form? Anyone ever had
this problem?

Thank you.
 
N

nybaseball22

It does not. The Dlookup is the Control Source for the text box. Do
I need to add it to the combo box after update? If I do, how would I
do that considering I already have code in the AfterUpdate?

Thank you
 
C

CTomac

It does not.  The Dlookup is the Control Source for the text box.  Do
I need to add it to the combo box after update?  If I do, how would I
do that considering I already have code in the AfterUpdate?

Thank you

Private Sub ComboBox_AfterUpdate()

Me.Refresh

'The rest of your code

End Sub
 
M

Marshall Barton

Hello. I am using a vlookup in a text box. The string looks up info
from a table based on a selection or the information already contained
in a combo box. The problem is, if I make a change to the information
in the combo box, the vlookup does not update. Could this be due to
code I have running in the AfterUpdate of my form? Anyone ever had
this problem?


You can, but the Dlookup's criteria needs to reference the
combo box directly. E.g.

=DLookup("x","table", "y=" & combobox)

What does the form's AfterUpfste event tie into this?
 
N

nybaseball22

My text box reads.


=DLookUp("[Type]","[BillMaintenance]","[Payee]=Forms![BillMain]!
[Payee]")

Type is the field in BillMaintenance Table whose info I want. Payee
is the combo box and the field in BillMaintenace that tie it all
together. I am sure you could figure this out, but I figured I would
note it.

Thank you
 

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