To debug this, open the Immediate window, and enter:
? DLookup("Product_name", "Product", "Product_no = '" &
Forms!YourFormNameHere.txt0 & "'")
For example, if Product_no is a Number field, (not a Text field), lose the
extra quotes:
DLookup("Product_name", "Product", "Product_no = " & Me.txt0
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Paul T. Rong" <et***@hotmail.com> wrote in message
news:_g*********************@news.chello.at...
Allen,
It does not work, while I followed your idea putting the following:
--------------------------------------
Private Sub txt0_AfterUpdate()
Me.ListBox1.Column(0) = DLookup("Product_name", "Product", "Product_no =
'"
& Me.txt0 & "'")
End Sub
--------------------------------------
Where is the problem?
Thanks,
Paul
"Allen Browne" <Al*********@SeeSig.Invalid> P4HkO{O"PBNE
:41***********************@per-qv1-newsreader-01.iinet.net.au... Use the AfterUpdate event procedure of the text box to set the Value of
the listbox.
If you do not know how to use DLookup() to get the product_name from your
table, see:
http://members.iinet.net.au/~allenbrowne/casu-07.html
Of course, you could just use a combo - that's kind of a combination of
text box and list box in one, and it will auto-complete the value as you type.
"Paul T. Rong" <et***@hotmail.com> wrote in message
news:5n********************@news.chello.at... >
> There is a unbound text box and a list box (product_name) in the form,
> users
> input a product number, the listbox shows the right product name.Is it
> possible? How to do it? Thank you for any ideas and suggestion.
>
> Paul from Bratislava, Slovakia