Returning tabled data to a text box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created:

1) An unfiltered Query that returns the field XYZ from a single table
2) A form and report bound to this query
3) A text in the form and report with the control source: XYZ

Goal:
Return the entire field XYZ as text in the text boxes, upon opening either
the report or form

Problems:
1) Form returns the field, but only to be navigated one record at a time.
2) Report returns the field but inserts a new text box for each record and
has giant gaps between each record
 
Problem 1: Set the form's default view to Continuous.
Problem 2: Make the text box just tall enough to accomodate a line of text,
and set its Can Grow Property to Yes. Size the form's Detail section
similarly, and set its Can Grow property to Yes.
 
Prob 1:
the continuous view takes care of the navigation prob, but each record is
still displayed independently regarldless of the "grow" setting

Prob 2:
Resizing the detail takes care of the gap but the records are still
essentially displayed independently in repeating text boxes

I am going to be doing some heavy formating later, so I need to know if its
possible to return multiple records to a text box, or in the example above a
whole field, and simply as text.
 
Ah. I think I see what you're getting at. You can combine fields in a query
or in a text box. For instance, if you have fields for City, State, Zip you
can combine them by creating a query based on the table, then adding a field
(column) in design view. In this example it may be called CityStateZip (or
CSZ, or whatever), and would look like this:
CSZ: [City] & ", " & [State] & " " & [Zip]
Note that you need to add things like spaces and punctuation enclosed by
quote marks. Quote marks are used for literal values rather than field names.
You can only combine fields from a single record. You cannot use this
technique to combine fields from multiple records.
Base your form on the query, and select CSZ as the field when you need the
combined value.
You can also use a similar technique to combine fields within a text box,
except that you would place the formula into the Control Source, preceded by
a = sign:
=[City] & ", " & [State] & " " & [Zip]
I prefer to use queries, but I suppose it's mostly a matter of preference
and convenience.
 
Back
Top