Textbox control source

  • Thread starter Thread starter Matt Williamson
  • Start date Start date
M

Matt Williamson

I can't figure out how to get textboxes on my form to display data from a
table. I've been messing around with the control source, but so far haven't
came up with anything that works.

There are 4 textboxes on my form and I want them each to pull values from
the 2nd field in a 2 column x 4 row table and if data is entered into them
or changed, write that back to the table.

TIA

Matt
 
Matt,

Build a very small subform that is a continuous form with one textbox. Set the
record source property of the subform to the table and the control source
property of the textbox to the second field in the table. Open properties for
the subform and set the Allow additions property to No.


--
PC Datasheet
A Resource for Access, Excel and Word Applications
(e-mail address removed)
www.pcdatasheet.com

· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel
 
PC-

This is in Access97. I tried what you suggested, but I'm not making heads or
tails of it.

I did end up setting the record source of my main form to the table and the
control source of my textboxes to the 2nd field in the table, but they are
all pulling the same data from the first row. How do I differentiate between
them? Can I set the control source to a specific row from the field? like
[Table Name]![Field Name]![row1] ? Or does the subform take care of that
somehow?

TIA

Matt
 
Matt,

I'm not meaning to be rude ----

Read my post again and do what it says. You didn't follow the directions at all!

Steve
PC Datasheet

Matt Williamson said:
PC-

This is in Access97. I tried what you suggested, but I'm not making heads or
tails of it.

I did end up setting the record source of my main form to the table and the
control source of my textboxes to the 2nd field in the table, but they are
all pulling the same data from the first row. How do I differentiate between
them? Can I set the control source to a specific row from the field? like
[Table Name]![Field Name]![row1] ? Or does the subform take care of that
somehow?

TIA

Matt

PC Datasheet said:
Matt,

Build a very small subform that is a continuous form with one textbox. Set the
record source property of the subform to the table and the control source
property of the textbox to the second field in the table. Open properties for
the subform and set the Allow additions property to No.


--
PC Datasheet
A Resource for Access, Excel and Word Applications
(e-mail address removed)
www.pcdatasheet.com

· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel
 
I should re-phrase what I said.

I tried doing what you said, but was unable to get it to work. I have no
clue what a subform is. I see a button on my design toolbar that says
subform/subreport. I add that to my form and I get a label and a box that
exposes none of the properties you mentioned. I look in the help file under
"What is a subform" and figure out that a subform exposes particular records
from a one to many relationship. My Main form isn't bound to anything. All
the controls are unbound and my queries are being written in code. So, I
figure since my main form isn't bound to anything, I can just bind it to my
table and then access it like that. That did work, but I only get the first
row in each textbox.

I also tried to open up a new database, add a table with 2 columns 4 rows
and follow your example, but I still don't understand. I'm a VB programmer
that is just starting access dev to clean up some existing projects that
someone else wrote.

I'll play with it some more. Once I figure out the relationships and how all
of the objects interact with each other better, I'll be golden. Thanks for
trying..

Matt


PC Datasheet said:
Matt,

I'm not meaning to be rude ----

Read my post again and do what it says. You didn't follow the directions at all!

Steve
PC Datasheet

Matt Williamson said:
PC-

This is in Access97. I tried what you suggested, but I'm not making heads or
tails of it.

I did end up setting the record source of my main form to the table and the
control source of my textboxes to the 2nd field in the table, but they are
all pulling the same data from the first row. How do I differentiate between
them? Can I set the control source to a specific row from the field? like
[Table Name]![Field Name]![row1] ? Or does the subform take care of that
somehow?

TIA

Matt

PC Datasheet said:
Matt,

Build a very small subform that is a continuous form with one textbox.
Set
the
record source property of the subform to the table and the control source
property of the textbox to the second field in the table. Open
properties
for
the subform and set the Allow additions property to No.


--
PC Datasheet
A Resource for Access, Excel and Word Applications
(e-mail address removed)
www.pcdatasheet.com

· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel



I can't figure out how to get textboxes on my form to display data
from
a
table. I've been messing around with the control source, but so far haven't
came up with anything that works.

There are 4 textboxes on my form and I want them each to pull values from
the 2nd field in a 2 column x 4 row table and if data is entered
into
them
or changed, write that back to the table.

TIA

Matt
 
Ok, I get it now. I have to create a form and the subform object added to my
original form is just an inline display of another form. Now it makes sense,
but still doesn't do what I'd like. I see how the subform does the updating
of the table, but I can't get it to display how I'd like with the names of
the funds next to the corresponding values.

PC Datasheet said:
Matt,

I'm not meaning to be rude ----

Read my post again and do what it says. You didn't follow the directions at all!

Steve
PC Datasheet

Matt Williamson said:
PC-

This is in Access97. I tried what you suggested, but I'm not making heads or
tails of it.

I did end up setting the record source of my main form to the table and the
control source of my textboxes to the 2nd field in the table, but they are
all pulling the same data from the first row. How do I differentiate between
them? Can I set the control source to a specific row from the field? like
[Table Name]![Field Name]![row1] ? Or does the subform take care of that
somehow?

TIA

Matt

PC Datasheet said:
Matt,

Build a very small subform that is a continuous form with one textbox.
Set
the
record source property of the subform to the table and the control source
property of the textbox to the second field in the table. Open
properties
for
the subform and set the Allow additions property to No.


--
PC Datasheet
A Resource for Access, Excel and Word Applications
(e-mail address removed)
www.pcdatasheet.com

· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel



I can't figure out how to get textboxes on my form to display data
from
a
table. I've been messing around with the control source, but so far haven't
came up with anything that works.

There are 4 textboxes on my form and I want them each to pull values from
the 2nd field in a 2 column x 4 row table and if data is entered
into
them
or changed, write that back to the table.

TIA

Matt
 
Back
Top