Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update or Append?

Status
Not open for further replies.

xandre

MIS
May 21, 2001
23
0
0
US
I have a table listing people's info, with soc sec# as primary key. It has names, addresses, phone # etc.

I'll be getting info via excel that has the same info as above, except perhaps someone's address has changed, and, there are new people to add.

How can I get this info into my current table? I tried an append qry, but, got key violations. I tried an update qry, but it wants me to 'input' information for it to update.

Which one would I use, and how do I get it to only change the addresses that have changed, but yet also add new members' info to the table?

Thanks,
Dawn
 
Before inserting or updating check for Record existence using SQL statement Like
"Select * from Table1 where SSN = '" & [Value from Excel & "'"

If Record count is greater than 0 then there is a record then use UPDATE statement else INSERT Please remember to give helpful posts the stars they deserve!
This makes the post more visible to others in need!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top