View Single Post
  #24  
Old March 22nd, 2008, 08:30 AM posted to microsoft.public.access.tablesdbdesign
Evi
external usenet poster
 
Posts: 898
Default Membership database updates

Yes of course. Back up your db before you start these procedures in case
they don't do what you expect them to.
I suggest that when you import stuff from Excel, first use an Append query
to put it into a table that has all the field names and data formats you
require (ie a copy/paste of the Main table but without its data. That way,
you can save all your append/update queries and use them next time because
none of the field or Table names will have changed. Your final query in the
series will be a Delete Query which will delete everything from this
ImportTable ready for next time.
.. Eventually, when you know that everything is working as you expect it to,
you can create a macro which runs everything, one after the other but you
can imagine the chaos it can create if it updates or appends the wrong thing
and you don't even see it as it happens..

If you want to replace everything for that member (and of course, I should
have thought of that!) different or not, then you can still use the Update
query. Join the 2 tables by the MemberNumber in Query Design. Put all the
fields from your *Current Table* (except MemberNumber) into your query grid.
Change to an Update Query.

In the UpdateTo row under each column, type eg

[YourImportTablesName]![FirstName]
or
[YourImportTablesName]![Surname]
etc

Substituting with the correct Table and field names. Remember, these Update
To entries must not have quote marks around them. Press the Red Exclamation
mark and run the query.
Evi




"Pennington" wrote in message
...
Thanks, I will try Evi's solution but when I read the blurb in the Access
Help I got the impression that I had to type an expression or value in the
Update To cell and I didn't want to have to do that - I just wanted to
replace the content if it was different. In fact it would not matter if

all
matching cells were replaced even if there was no difference.

"John W. Vinson" wrote:

On Fri, 21 Mar 2008 12:21:01 -0700, Pennington
wrote:

I have encountered a problem.
When I run the Append Query it adds new members to the Members Table

and
does not add duplicates which is fine but I want to also update the

Members
Table where the data in a field is different (The Primary Key will not

change
but titles, addresses and e-mails may change). I have looked at an

Update
Query but this is not appropriate. What other type of query can I use

for
this?


In what way is an update query inappropriate? If you want to update

existing
records from a second table matching by primary key, an Update Query is
exactly what you would use!

--

John W. Vinson [MVP]