Linking in forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 2 tables. 1 new table and 1 linked table with data in it.
I want in the form that when I add the ID # some information from the linked
table is automatically entered.

Can this be done?
 
Jaimi.

It can be done, but is probably not necessary nor desirable.

Unless the data in the linked table is time-dependent, such as today's unit
price, there is no need to store it redundantly in the second table--simply
store the ID#, and use a query to link the tables.

If you meant *display* other fields in other textboxes, include the fields
you wish to display as columns in a combo box where you enter the ID#. Then
set the textbox' ControlSource to:

= YourComboBox.Column(x), where x is the column index, starting with zero.

If you really do need to store the data redundantly, use the AfterUpdate
event of the combo box to assign values to a textbox bound to the field in
the 2nd table (that is, whose ControlSource is set to the field name):

YourTextBox = YourComboBox.Column(x)

Hope that helps.
Sprinks
 
Do you mean to have the linked table information as a subform?
Create a form to display the linked table data and include the common field.
The common field property Visible can be No.
Open you main form in design view and click on the toolbox icon (it is a
hammer crossed with a wrench). Move the cursor over the icons to find
subform and click. Follow the prompts including the Master and Child links
(that common field).
 
Back
Top