Display warning if update query changes client name

S

Steve

I am using an update query to make demographic information updates to my
client table ("tlbClient"). The source for updates is "tblClientCurrentData"
which is populated from an text file import from a separate database that is
kept current by my company staff. Rarely client names change so I would like
to include this field in my update query but I would like to be notified if a
name is being changed as a result of the update query so that I can make sure
there isn't an error. When I run an update query, it appears that all of the
records are "updated" even if no change actually occurs. How can I have the
program distinguish if there is a change happening in the tblClient table
name? Thanks for any help.
 
B

Brendan Reynolds

Run a select query before running the update query that returns only records
where the names don't match. For example ...

SELECT tblClient.ClientName AS OldName, tblClientCurrentData.ClientName AS
NewName
FROM tblClient INNER JOIN tblClientCurrentData ON tblClient.ClientID =
tblClientCurrentData.ClientID
WHERE (((tblClient.ClientName)<>[tblClientCurrentData].[ClientName]));

This example assumes that both tables have a numeric field named ClientID
which is the primary key.
 

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

Top