Find a value in a listbox, then show it?

  • Thread starter Thread starter Stephen Russell
  • Start date Start date
S

Stephen Russell

I need to update a display in a listbox because of other user activity in
form.

How do I look through a controls list to find the proper row to display?

My textbox control that I want to base off of as this is correct, is called
Name.

Rowsource for Combobox27 =
SELECT Company.CmpID, Company.Name FROM Company ORDER BY 2;

How do I compare the value in textbox Name and find it and SHOW the same one
in Combobox27?

TIA
 
I don't know why you would want to do this - it's usually the other way
around -

The only way I can think of is to do something like this:

[combobox27]=me![textbox],

and that will work only if the bound column of the combo box is the same
as the data in the text box (if it works at all)

John
 
Dear Goddard,
Thanks for straigth me ahead. I've just fool up myseft ! It much be more
simple than I though.
Dear Stephen Russell,
Based on J. Goddard, you may try this:
1. Change your Combo Box's Row Source to something like:
SELECT Company.CmpID, Company.Name FROM Company WHERE
(((Company.CmpID)=Forms!YourForm!YourListBox)) ORDER BY 2;
- Set Bound Column: 1; Column Count: 2; Column Width: 0 (If you want to show
Company's Name)
2. Change your List Box's Row Source to :
SELECT Company.CmpID, Company.Name FROM Company ORDER BY 2;
- In ListBox's After Update event, add: Me.Combo27.Requery
Then you don't even need your TextBox.
Bsrg.

J. Goddard said:
I don't know why you would want to do this - it's usually the other way
around -

The only way I can think of is to do something like this:

[combobox27]=me![textbox],

and that will work only if the bound column of the combo box is the same
as the data in the text box (if it works at all)

John



This link may help:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;289670
This article describes how to synchronize two combo boxes so that when you
select an item in the first combo box, the selection limits the choices in
the second combo box - But I think you could use for listbox also.

:
 
Back
Top