Update one field with multiple alternatives in one query

  • Thread starter Thread starter Baxter1677
  • Start date Start date
B

Baxter1677

I have one company type field with multiple values that I
would like to update to a new names. For example in the
company type field I have values of AA and AB, etc. I
want to run an update query to change AA to Hosptial
Undefined, AB to Hospital Children's. In total I have 30
values that need to change. I don't know visual basic
but can I do this all in one query?
 
I have one company type field with multiple values that I
would like to update to a new names. For example in the
company type field I have values of AA and AB, etc. I
want to run an update query to change AA to Hosptial
Undefined, AB to Hospital Children's. In total I have 30
values that need to change. I don't know visual basic
but can I do this all in one query?

You don't need any VB to do it; instead, create a small (thirty-row,
two-field) translation table (tblCodes) with the code (AA let's say)
as its Primary Key, and the desired name as a Text field (NewName).

Create a Query joining this table to your company table; change it to
an Update query; and update [Company Type] to

[tblCodes].[NewName]
 
Back
Top