Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2011
    Posts
    48

    Unanswered: Using Select and updating the table

    Hi,

    With all of the help here my database is almost to the point where it works!

    I just have one problem.

    If I use the following in a query:

    select

    Switch(asscomp_code IS NOT NULL,'NONRISK') AS risk_nonrisk_type

    FROM Details;

    When I input changes, it changes the risk_nonrisk_type field to NONRISK in the query, but it won't update it in the table Details. Is there a way so that it will also update the table automatically?

  2. #2
    Join Date
    Jan 2009
    Location
    Kerala, India
    Posts
    183
    Run an UPDATE Query (not SELECT) with the following Syntax to update a particular record:

    Code:
    UPDATE Details SET Details.risk_nonrisk_type = Switch(asscomp_code IS NOT NULL,'NONRISK')
    WHERE (((Details.FLAG)=True));
    Don't forget to add the WHERE clause to refer to specific record or group of records.

    NB: Backup a copy of your table before attempting to try out the above example.
    www.MsAccessTips.com (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

  3. #3
    Join Date
    Sep 2011
    Posts
    48
    Quote Originally Posted by apr pillai View Post
    Run an UPDATE Query (not SELECT) with the following Syntax to update a particular record:

    Code:
    UPDATE Details SET Details.risk_nonrisk_type = Switch(asscomp_code IS NOT NULL,'NONRISK')
    WHERE (((Details.FLAG)=True));
    Don't forget to add the WHERE clause to refer to specific record or group of records.

    NB: Backup a copy of your table before attempting to try out the above example.

    Thanks! Able to use this. If I need more help I'll come back here!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •