473,473 Members | 1,488 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

users type the product number in a text box, the list box shows the right product name, how to do it?

Hi there!

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
Nov 13 '05 #1
3 1471
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.

--
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: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

Nov 13 '05 #2
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> дÈëÏûÏ¢ÐÂÎÅ
: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.

--
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: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


Nov 13 '05 #3
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

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jim in Arizona | last post by:
My goal, somehow, is to populate a dropdownlist with all the user names in active directory. I don't even know where to begin, really. I added a reference to System.DirectoryServices so I could...
2
by: rick | last post by:
Hi friends What is the best way to keep track of number of users logged into database everyday. Where does db2 store user connection information ? does it keep a log of user connections? ...
2
by: printline | last post by:
Hi all I have a problem with a form script. The form script should do the following: When a user selects a value from a drop down list and hits the "next" button it should take him to a...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.