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!

Displaying Multiple Fields from Multiple records in one text box

Status
Not open for further replies.

NewfieGolfer

Technical User
Mar 29, 2001
80
CA


I need to display the values of a field in one text box. There are more than one record. I want to display all the values of that field in one text box.

ex. Table
ID Price Sq Ft
1 5.56 3
1 4.78 5
1 4.89 7

In a text box on a form I need to display all the prices for ID 1:

ID: 1 <-- Text Box 1

Price <-- Text box 2
5.56
4.78
4.89

I'm only worried about setting up Text box 2 to display as shown above

Any Ideas Appreciated,

Chris
 
The easiest way is probably to create a subform which contains a text box displaying the price. Just create a form with one text box, set the control source equal to the Price field, and add this as a subform to your main form, linking on the ID field.

Or, you could use a list box. The following code in the On Current event of your form will populate the list box with the Prices for the current ID:
Me.ListBoxName.RowSource = &quot;SELECT Price FROM [TableName] WHERE ID = &quot; & Me.ID
Substitute the correct names for ListBoxName and TableName.
 
I'm having the same problem and I can't find a solution anywhere!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top