Vlookup problem

  • Thread starter Thread starter nybaseball22
  • Start date Start date
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.
 
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
 
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
 
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?
 
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
 
Back
Top