Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Feb 2004
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    expression in update query (Access 2002)

    I have a series of letters 1-2-3, and am trying to change the [letter # ] to go 1-up whenever I run the query. It should cycle among letters 1, 2, and 3 (3->1; 2->3,;1->2).
    Next time I run the query, it should go one-up again, cycling.
    I don't know what (perhaps modulus??) can be used in ACCESS to do this. Anybody have a cool suggestion?
    I tried using something like IIf(0([o_ltr]), 01, [o_ltr]) in the UPDATE TO: in the Query Builder Grid, but there's an error saying that I'm using parentheses wrong.
    Any ideas?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: expression in update query (Access 2002)

    Create a query based on your table.
    Select Query | Update Query to change the query into an update query.
    Add the o_ltr field to the query grid.
    Enter Is Not Null in the Criteria line, to avoid updating blank values (if any).
    Enter ([o_ltr] Mod 3)+1 in the Update to line.

  3. #3
    Lounger
    Join Date
    Feb 2004
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: expression in update query (Access 2002)

    Yay Hans! Thanks for the help. Works like a charm.

Posting Permissions

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