Bound Controls

G

Guest

I'm trying to learn about Access forms. I'm new to designing a form from
scratch. I am not understanding what happens with a bound control that I
create and use the properties box to specify the field. When I click the
Build button, the Expression Builder pops up. I then choose Tables, and
select the table from which I want to use the field. The fields pop up in
the second list box, and I select the appropriate field. This all appears in
the Expression builder as follows:

[tblProducts]![ProductID}

When I close the Expression Builder and the properties box, that expression
appears in my control. However, when i switch to design view, the text box
shows an error, specifically "Name?". I know that if I am creating a form
based on the tblProducts I can just pull that field from the field list, but
I am trying to understand this control source thing. I was thinking that
might be a way to create a link on a form that comes from another table other
than the one the form is already based on.

Can anyone explain this to me in easy to understand terms?

Thanks,
Sherry
 
K

Ken Snell [MVP]

The control source of a textbox cannot contain a reference to a table /
field that is *not* in the form's RecordSource. If the form is based on the
"tblProducts" table, then the control source would be ProductID if you want
to bind that textbox to that field.

The error that you see ("#Name") suggests that tblProducts and/or ProductID
from that table are not found in the form's Recordsource.
 
G

Guest

Thanks for your reply. I think I can grasph that. Can you tell me, then,
just what the purpose of the Control Source field is in the property box?
What is its purpose?
--
Sherry


Ken Snell said:
The control source of a textbox cannot contain a reference to a table /
field that is *not* in the form's RecordSource. If the form is based on the
"tblProducts" table, then the control source would be ProductID if you want
to bind that textbox to that field.

The error that you see ("#Name") suggests that tblProducts and/or ProductID
from that table are not found in the form's Recordsource.

--

Ken Snell
<MS ACCESS MVP>

Ladypep said:
I'm trying to learn about Access forms. I'm new to designing a form from
scratch. I am not understanding what happens with a bound control that I
create and use the properties box to specify the field. When I click the
Build button, the Expression Builder pops up. I then choose Tables, and
select the table from which I want to use the field. The fields pop up in
the second list box, and I select the appropriate field. This all appears
in
the Expression builder as follows:

[tblProducts]![ProductID}

When I close the Expression Builder and the properties box, that
expression
appears in my control. However, when i switch to design view, the text
box
shows an error, specifically "Name?". I know that if I am creating a form
based on the tblProducts I can just pull that field from the field list,
but
I am trying to understand this control source thing. I was thinking that
might be a way to create a link on a form that comes from another table
other
than the one the form is already based on.

Can anyone explain this to me in easy to understand terms?

Thanks,
Sherry
 
K

Ken Snell [MVP]

Two purposes:

(1) Bind the textbox to a field so that the field is updated when the
textbox's data are entered/edited.

(2) Use an expression to display a calculated value in the textbox (e.g., to
display today's date, or to show the value of a field in a record in a table
that isn't in the form's RecordSource, etc.). When this is done, the data in
the textbox cannot be edited in any way.

--

Ken Snell
<MS ACCESS MVP>


Ladypep said:
Thanks for your reply. I think I can grasph that. Can you tell me, then,
just what the purpose of the Control Source field is in the property box?
What is its purpose?
--
Sherry


Ken Snell said:
The control source of a textbox cannot contain a reference to a table /
field that is *not* in the form's RecordSource. If the form is based on
the
"tblProducts" table, then the control source would be ProductID if you
want
to bind that textbox to that field.

The error that you see ("#Name") suggests that tblProducts and/or
ProductID
from that table are not found in the form's Recordsource.

--

Ken Snell
<MS ACCESS MVP>

Ladypep said:
I'm trying to learn about Access forms. I'm new to designing a form
from
scratch. I am not understanding what happens with a bound control that
I
create and use the properties box to specify the field. When I click
the
Build button, the Expression Builder pops up. I then choose Tables,
and
select the table from which I want to use the field. The fields pop up
in
the second list box, and I select the appropriate field. This all
appears
in
the Expression builder as follows:

[tblProducts]![ProductID}

When I close the Expression Builder and the properties box, that
expression
appears in my control. However, when i switch to design view, the text
box
shows an error, specifically "Name?". I know that if I am creating a
form
based on the tblProducts I can just pull that field from the field
list,
but
I am trying to understand this control source thing. I was thinking
that
might be a way to create a link on a form that comes from another table
other
than the one the form is already based on.

Can anyone explain this to me in easy to understand terms?

Thanks,
Sherry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top