enter data into one field and then auto populate other fields

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

Guest

Within a form, I want to auto populate serveral fields based on data in one
table. However I do not want to add a subform.

Can this be done simply? If not, please advise what documentation I can
read to learn how to accomplish this goal.
 
You don't really tell us how you would 'autopopulate' the fields. I'm
guessing you mean that you will select a customer number, then you want the
name and address to fill in?

If so, look at the Northwinds sample database that comes with access. I
think it is the orders form that does this. I know one of them does.
 
Hi, Viewpoint.

If you are trying to *store* additional fields from what you call "one
table" into fields of the form's RecordSource, this is not a sound approach.
In a normalized relational database, you should store only the foreign key
(corresponding to the one table's primary key). For example, in an Orders
table, you would store only the CustomerID to identify the customer, not the
name, address, etc.

If you are trying merely to *display* information on your form in unbound
controls, there are 2 ways to do it:

1. Base your form on a query of the two tables, linked by the
primary/foreign key. Include the foreign key in the recordset, but not the
primary key. Also select the fields from the "lookup" table that you wish to
display.

2. Include the other fields as columns in a combo box, then refer to them
using the combo box' Column property (indexed starting with zero). For
example, to display the third column of a combo box in an unbound textbox,
set its ControlSource to:

=Me!MyComboBox.Column(2)

Hope that helps.
Sprinks
 
Back
Top