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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find data to display in a text box on form

Status
Not open for further replies.

mkphan

IS-IT--Management
Jan 9, 2001
18
US
I have a table called [item]:

ITEM_ID DESCRIPTION
1 Shoe
2 Jacket
3 Socks

On a form, I have a combo box displaying [ITEM_ID] for the user to select from.

Then, I want to display [DESCRIPTION] of the selected item in a text box. How do I achieve this task?

Many thanks ahead of time for your help,

MK
 
Mkphan,

Create a new textbox and in the RowSource property, type: =[ITEM_ID].Column(1)

When the view the form in Form view, you should see your description based on the Item_ID.

Hope this helps you.
 
In reply to the first reply, a text box will not have a RowSource property.

Try this code:

Public Sub ITEM_ID_AfterUdate()

TextBox = ITEM_ID.Column(1)

End Sub

You will have to have the column count of the combo box set at 2 and the column widths at 1;0.

Email me if you want more info.
 
LonnieJohnson,

SORRY!

Didn't mean ROWSOURCE. I meant CONTROLSOURCE.

Mkphan,
This is a very simple way of displaying column data without creating a sub. I use it all the time. Works great!
 
It works!
Thank you all so much for your help...

MK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top