How to copy other fields after combobox look up

S

Song

I use wizard to look up SID in qryStudent and store info in current table.
How to copy LastName, FirstName of same SID from qryStudent into current
table as well?
 
A

Allen Browne

You don't.

One of the basic rules of data normalization is that you do not duplicate
the same data across multiple tables. There should be only *one* place where
someone's lastname is stored. You store onlly the Student ID in the related
table. When you need the name, you create a query that uses both tables, and
you can easily get the name.

Otherwise you create a maintenance nightmare, trying to keep everything up
to date in all the tables where the data is duplicated.
 
S

Song

I know that data should be saved in one place and link tables. However, this
is a special situation and this small table I'm going to hold is temporary
and only contain less than 10 records and requently get deleted.
 
L

Lord Kelvan

one way would be to use an append query rather than a lookuplist

insert into mytable (fisrtname,lastname,sid)
select firstname,lastname,sid
from qrystudent
where sid = myvalue

basically it will find the sid in qrystudent and then insert thoes
values into your tempory table

as a note what are you trying to achieve becuase there may be a better
way that you just dont realise

Regards
kelvan
 
Top