Bind a form field to another table

G

Guest

I built a form using Table A, all of my text boxes are bound to table A. Now
I need to fill in a text box that uses Table B.

I go to the new text box, select properties, then I go to Control Source...
I select the table, and field I will populate.
But, everytime I run the form I see this "#Name?" in the box and I cannot
edit it... What am I doing wrong?

Thanks in advance! Paul
 
D

Dirk Goldgar

PaulV said:
I built a form using Table A, all of my text boxes are bound to table
A. Now I need to fill in a text box that uses Table B.

I go to the new text box, select properties, then I go to Control
Source... I select the table, and field I will populate.
But, everytime I run the form I see this "#Name?" in the box and I
cannot edit it... What am I doing wrong?

Thanks in advance! Paul

A form can only have one recordsource, which can be a single table or a
query that joins multiple tables. If Table B is related to Table A,
then maybe you can base your form on a query that joins the two tables
on the linking field. That would allow you to bind a control on the
form to that field. Be aware, though, that joining two tables that have
a one-to-many relationship will result in an apparent duplication of
each record from the "one" table that is matched by multiple records
from the "many" table. So the usability of this approach depends on the
relationship between the tables. If your "Table A" is the "many" table
in the relationship and Table B is the "one" table, then basing your
form on a query joining them will probably work the way you want.

If Table A is the "one" table in the relationship, then you'd do better
to use a subform based on Table B. And if there is no relationship
between the tables, you'd better explain the details of what you're
trying to achieve, in order to get better advice.
 
G

Guest

Hi Paul
You need to define Table B in the record source of the form, and then add
the field to the field list of the record source.

Then on the form, open the control source of the field, and you'll see the
field name apear in the list of the fields, by clicking on the field
selection.
But I't could be that the link of the two tables wont allow you edit the
fields any more, in that case you'll need to create a subform that is based
on TableB.
 

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