Udating a field

Posted on 2011-10-27
Last Modified: 2012-06-21
I have a table which contains 2 fields; Description and Color
In an update query how do I set the value of Color to "gold" if the Description field contains the word "gold" ?
Question by:garysamuels
    LVL 75

    Accepted Solution

    Maybe something like this:

    UPDATE Table7 SET Table7.Color = IIf(InStr(1,[Description],"Gold")>0,"Gold",[Description]);

    Make a backup first - before running a test Update query.

    LVL 19

    Assisted Solution

    Try this:

    UPDATE Table1 SET Table1.Color = "Gold"
    WHERE (((Table1.Description) Like "*" & "gold" & "*"));

    LVL 19

    Assisted Solution

    This is how your query in design view looks like:

    LVL 75

    Assisted Solution

    by:DatabaseMX (Joe Anderson - Access MVP)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now