How to copy other fields after combobox look up

  • Thread starter Thread starter Song
  • Start date Start date
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?
 
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.
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top