How can I populate records from a table into a TextBox?

  • Thread starter Thread starter Messa Boogie
  • Start date Start date
M

Messa Boogie

How can I populate records from a table into a textbox?
I don't really want to use a listbox or anything else. I want
to use a TextBox.

Help
 
Not sure what you mean. A textbox would typically hold one value. A list
box will hold all the values available. To populate a textbox, just put the
underlying field in the data source.

Please give us an example of what you are trying to do if this does not
answer your question.
 
Oh sorry Rick for not explaining enough. Here is a more detailed version...

I would like to populate a textbox with the data from a table. For
example, if this were my table...

Table1:
Color Number Notes
blue 3 some notes
red 4 alot of notes here that might be a whole paragraph

Then here is what I would like my textbox to look like....
Textbox1:
blue 3 some notes
red 4 alot of notes here that might be
a whole paragraph

Notice that in the textbox the second line would wrap around to the
next line. I'm open to a better way of doing this, but it seems that a
ListBox wouldn't do the "wrap" properly so it looks like I'm stuck with a
TextBox.

Your comments?
 
Then you'd just create an unbound text box and put the following in it...

=[Color] & " " & [Number] & " " & [Notes]
 
Wow - that was amazingly easy.

That almost works - the only problem is that I am not needing it
to pull data from the form's source, I need to pull data from a different
table. Is there a way to alter the code to make it reference "Table2"?




Rick B said:
Then you'd just create an unbound text box and put the following in it...

=[Color] & " " & [Number] & " " & [Notes]

--
Rick B



Messa Boogie said:
Oh sorry Rick for not explaining enough. Here is a more detailed
version...

I would like to populate a textbox with the data from a table. For
example, if this were my table...

Table1:
Color Number Notes
blue 3 some notes
red 4 alot of notes here that might be a whole paragraph

Then here is what I would like my textbox to look like....
Textbox1:
blue 3 some notes
red 4 alot of notes here that might be
a whole paragraph

Notice that in the textbox the second line would wrap around to the
next line. I'm open to a better way of doing this, but it seems that a
ListBox wouldn't do the "wrap" properly so it looks like I'm stuck with a
TextBox.

Your comments?
 
I assume there is some field in common between the two tables? Just add
table 2 to the query (upon which your form is based) and make sure to draw
the line to link the two tables.


--
Rick B



Messa Boogie said:
Wow - that was amazingly easy.

That almost works - the only problem is that I am not needing it
to pull data from the form's source, I need to pull data from a different
table. Is there a way to alter the code to make it reference "Table2"?




Rick B said:
Then you'd just create an unbound text box and put the following in it...

=[Color] & " " & [Number] & " " & [Notes]

--
Rick B



Messa Boogie said:
Oh sorry Rick for not explaining enough. Here is a more detailed
version...

I would like to populate a textbox with the data from a table. For
example, if this were my table...

Table1:
Color Number Notes
blue 3 some notes
red 4 alot of notes here that might be a whole
paragraph

Then here is what I would like my textbox to look like....
Textbox1:
blue 3 some notes
red 4 alot of notes here that might be
a whole paragraph

Notice that in the textbox the second line would wrap around to the
next line. I'm open to a better way of doing this, but it seems that a
ListBox wouldn't do the "wrap" properly so it looks like I'm stuck with
a
TextBox.

Your comments?






"Rick B" <Anonymous> wrote in message
Not sure what you mean. A textbox would typically hold one value. A
list box will hold all the values available. To populate a textbox,
just put the underlying field in the data source.

Please give us an example of what you are trying to do if this does not
answer your question.

--
Rick B



How can I populate records from a table into a textbox?
I don't really want to use a listbox or anything else. I want
to use a TextBox.

Help
 
Yes, there are two common fields: ID and BID. I tried adding Table2 to the
query, but this didn't work. Perhaps I am doing it wrong. Here is
what I did...

Tools / Relationships
Added the two tables, connected ID and BID.

I am kind of new at this. What am I doing wrong?






Rick B said:
I assume there is some field in common between the two tables? Just add
table 2 to the query (upon which your form is based) and make sure to draw
the line to link the two tables.


--
Rick B



Messa Boogie said:
Wow - that was amazingly easy.

That almost works - the only problem is that I am not needing it
to pull data from the form's source, I need to pull data from a different
table. Is there a way to alter the code to make it reference "Table2"?




Rick B said:
Then you'd just create an unbound text box and put the following in
it...

=[Color] & " " & [Number] & " " & [Notes]

--
Rick B



Oh sorry Rick for not explaining enough. Here is a more detailed
version...

I would like to populate a textbox with the data from a table. For
example, if this were my table...

Table1:
Color Number Notes
blue 3 some notes
red 4 alot of notes here that might be a whole
paragraph

Then here is what I would like my textbox to look like....
Textbox1:
blue 3 some notes
red 4 alot of notes here that might be
a whole paragraph

Notice that in the textbox the second line would wrap around to the
next line. I'm open to a better way of doing this, but it seems that a
ListBox wouldn't do the "wrap" properly so it looks like I'm stuck with
a
TextBox.

Your comments?






"Rick B" <Anonymous> wrote in message
Not sure what you mean. A textbox would typically hold one value. A
list box will hold all the values available. To populate a textbox,
just put the underlying field in the data source.

Please give us an example of what you are trying to do if this does
not answer your question.

--
Rick B



How can I populate records from a table into a textbox?
I don't really want to use a listbox or anything else. I want
to use a TextBox.

Help
 
Rick,

I looked around some more and I think I got what you were
saying. I went to the properties of the form and edited the
Record Source.

That works - as long as there is only one record in Table2
that matches Table1. But if there are multiple records in
Table2 then the rest of the records are not displayed.
Sorry for leaving that out of the last post. I didn't think
it was important (oops).

So here is another scenario of what I am trying to
accomplish...

Table1
ID Name
1 John
2 James
3 Rachel

Table2
ID Date Notes
1 01-01-2006 Sent a fax
1 01-03-2006 Had consultation meeting
1 01-05-2006 Met with customer
2 01-01-2006 Ran a mark
2 01-02-2006 Ran a mark with second shift

And then my textbox would display this...
(if ID #1 was the current record...)
01-01-2006 Sent a fax
01-03-2006 Had a consultation meeting
01-05-2006 Met with customer

(here ist is if ID 2 was the current record...)
01-01-2006 Ran a mark
01-02-2006 Ran a mark with second shift

Help


Rick B said:
I assume there is some field in common between the two tables? Just add
table 2 to the query (upon which your form is based) and make sure to draw
the line to link the two tables.


--
Rick B



Messa Boogie said:
Wow - that was amazingly easy.

That almost works - the only problem is that I am not needing it
to pull data from the form's source, I need to pull data from a different
table. Is there a way to alter the code to make it reference "Table2"?




Rick B said:
Then you'd just create an unbound text box and put the following in
it...

=[Color] & " " & [Number] & " " & [Notes]

--
Rick B



Oh sorry Rick for not explaining enough. Here is a more detailed
version...

I would like to populate a textbox with the data from a table. For
example, if this were my table...

Table1:
Color Number Notes
blue 3 some notes
red 4 alot of notes here that might be a whole
paragraph

Then here is what I would like my textbox to look like....
Textbox1:
blue 3 some notes
red 4 alot of notes here that might be
a whole paragraph

Notice that in the textbox the second line would wrap around to the
next line. I'm open to a better way of doing this, but it seems that a
ListBox wouldn't do the "wrap" properly so it looks like I'm stuck with
a
TextBox.

Your comments?






"Rick B" <Anonymous> wrote in message
Not sure what you mean. A textbox would typically hold one value. A
list box will hold all the values available. To populate a textbox,
just put the underlying field in the data source.

Please give us an example of what you are trying to do if this does
not answer your question.

--
Rick B



How can I populate records from a table into a textbox?
I don't really want to use a listbox or anything else. I want
to use a TextBox.

Help
 
Back
Top