Display warning if update query changes client name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 
Back
Top