John's advice is invariably concise and accurate, so I hope I am not
muddying
the waters here. Table 1 is the unchanging information about the customer
(name, address, etc.) and Table 2 is job details? I would think that if
the
primary key field in Table 1 is Autonumber data type, Table 2 should
contain
a field of the same name (helpful but not essential that the fields have
the
same name) and data type Number. Use table design view to accomplish
this.
Set up a relationship (see Help if needed) between the two tables by
linking
the fields I mentioned. Use autoform to make a form based on Table 1, and
Table 2 should appear as a subform.
In general, don't store data twice. An exception might be that you need
an
employee's name to appear on a record as it was at the time the record was
created, in which case you would store the name rather than the NameID.
If
you need main form information (name and address, for instance) to appear
elsewhere on the form you could just add another text box bound to the
appropriate field. To add it to the subform, you could use an unbound
text
box containing =Forms![frmCustomer]![txtCustName].
By establishing relationships you can view related information whenever
you
want. You don't need to store it. If you store the customer primary key
(you can still view the customer name) your records will remain cohesive
even
if the customer name changes.
By the way, maybe the names Table 1 and Table 2 are just for convenience
in
posting your question, but if you are using the default Access names for
tables, forms, etc. and for controls such as combo boxes, do yourself a
favor
and implement an orderly and descriptive naming convention.
indigo said:
ah,.. your correct i wasn't fully aware of that.
i understand (a bit) what you mean now..
in essence i was thinking of using table 1 as a store of information,
partially quite seperate from the main table. rather than as it should
be, a
working component of the db overall.. (am i close here)
So table 2 will include the customer details but wont include the address
as
this is already linked via table 1 (duh! where's homer simpson when i
need
him)
and in the subform will i use the =combobox.Column(n) to bring up the
address info?
Also with regard to putting the customer info into table 2 will this pick
up
from the subform?
just about to sit and try this out..
i really appreciate your time answering these tiresome questions.
thanks
On Wed, 5 Jan 2005 01:33:14 -0000, "indigo"
hi...
currently have a database with 2 tables.
table 1 is has name and address info in it only.
table 2 has job run information. this links to table 1 via drop down
box
as
there can be several different job runs for the same customer in table
1.
what i would like to do, and seemed to have hit a bit of a wall, is to
select the name from drop down box in the form, which inputs that info
into
table 2 (no problem there) but when i select the name i'd like the
address
information to fill in that colum automatically based on the address in
table 1. this is to save having to look through addresses each time.
i've tried using =combobox.Column(n) to do this but so far have failed
to
get the information into the table.
You're misunderstanding how relational databases work. The second
table should NOT contain the address field. It's redundant!
You can use a Query joining the two tables in order to see the address
data in conjunction with the job information; or, you can use a Form
based on Table1 with a Subform based on Table2.
John W. Vinson[MVP]