Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with a Form

Status
Not open for further replies.

mike1975

IS-IT--Management
Jun 26, 2001
38
GB
I have a form where the user has to pick out a salesreps code. I have the combo box working just fine so that they can do this, I would like to create a text box next to the combo box that will display the reps name rather than the code. I imagine I would have to use some form of lookup but I am not sure how. Help would be greatly appreciated.

MIKE
 
Hi Mike,

select in the row source query for combobox both the code and the name of the salesrep. If you don't want both columns displayed, you can hide not-wanted columns. Just set column widths property (like 5cm;0cm - the second column won't be displayed). Then in afterupdate event of combobox write

TextBox=Combobox.column(x)

where x=the number of column where name in combobox is. Columns start counting from 0, so if name is in the second column, use 1 for x.

That way the contents of specified column fom selected item will be shown in text box.

Another suggestion... If you don't need code on the form, just hide that column in the combobox. YOu can still use the bound column property to store the code, but in combobox you can display only names. That way you don't need another text box to show name.


Hope it helps
Mangro
 
Thanks Mangro,

I used the second method to sort it out - really simple as it often is! Mant thanks - MIKE
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top