Bind form to more than one table

  • Thread starter Thread starter XP
  • Start date Start date
X

XP

Using Office 2003 and Windows XP;

I have a form that is bound to a table. On the form I dragged several of the
fields directly from the field list and it opens in datasheet view.

I would really like to add a couple fields from another table to this form.
I suspect it isn't possible since it seems probable that one can't bind a
single form to two tables at once. However, I have come to learn that many
things are possible when asking this forum.

So, is it possible? If not, is there a work-around? What can I do to get
this to work?

Thanks much in advance.
 
You can create a query containing the 2 tables, and bind the form to the
query.

Whether this will work well or not depends. In general, it works as long as
you are only trying to insert/edit/delete records on the many side of a
one-to-many relationship, and just using the other table for lookup values.
 
Another option is to write some code for the forms Current event to lookup
the data from table2 whenever you change the record and put it in the
appropriate controls.

Then in the forms BeforeUpdate or AfterUpdate events, you could reverse that
process and post the data from those controls back to table2, if they changed.

HTH
Dale
 
Back
Top