Two times

  • Thread starter Thread starter Keith
  • Start date Start date
K

Keith

I'm setting up a query that I will be using to add data
to two tables. The first table is the primary table and
it may or may not have data in it. I use the SSN as the
Primary Key and with the query use a like query to look
for the ssn.

Can I set it up so that if the SSN is not in the primary
table the it will put it into the primary key
field "ind_ssn" As it is now the user must type the ssn a
second time if the ssn is not found.

Code:

SELECT DEPS.indiv_name, DEPS.ind_ssn, DEPS.rctg_stn_id,
DEPS.SVC
FROM DEPS
WHERE (((DEPS.ind_ssn) Like [Enter SSN] & "*"));

Keith
 
SSN is not a good candidate for a primary key. For no other reason than
they are not unique. Every 100 years they are recycled.

That being said, you can use the Unmatched Query Wizard to help you
construct a query to find data that does NOT exist in table. Then, use that
query as the basis of your append query to get the data into the Parent
Table.

--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Back
Top