Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

macro for making a field value determined by the value of another field

Discussion in 'Information Technology' started by kennethburr@sbcglobal.net, Jul 28, 2006.

  1. kennethburr@sbcglobal.net

    kennethburr@sbcglobal.net
    Expand Collapse
    Guest

    I am tried to write a macro (I don't know code) in Microsoft Access
    2003 that will place a certain value in a field#2 depending on what
    value is in field#1. For example if the value in field#1 is any number
    between 0 and 100 then the value of field#2 will be 1, and if the value
    of field#1 is any number between 101 and 200 then the value of field#2
    will be 3, and if the value of field#1 is any number between 201 and
    300 then the value of field#2 will be 10. I just joined this group so
    my question may not be in the right format, but I would greatly
    appreciate any help.
     
  2. Loading...

    Similar Threads Forum Date
    Microcosm and Macrocosm Gurmat Vichaar Mar 20, 2009
    Adobe Unruffled by Macromedia Restatement (AP) Interfaith Dialogues May 4, 2005
    Macromedia Flash animation and designing. Interfaith Dialogues Oct 21, 2004
    Partition 1947 - The Making Of Refugees History of Sikhism Mar 18, 2015
    Making The Change With Hope & Faith - Sikh Advocate Prabhjot Singh, Md Sikh Youth Mar 11, 2015

  3. arthurjr07@gmail.com

    arthurjr07@gmail.com
    Expand Collapse
    Guest

    Use RunSQL macro to run this SQL script.

    UPDATE Table1 Set Table1.FIELD2 =
    IIf(([Table1]![FIELD1]>0 And [Table1]![FIELD1]<101),1,
    IIf(([Table1]![FIELD1]>101 And [Table1]![FIELD1]<201),3,
    IIf(([Table1]![FIELD1]>201 And [Table1]![FIELD1]<301),10,0)));

    hope this will help
     
  4. kennethburr@sbcglobal.net

    kennethburr@sbcglobal.net
    Expand Collapse
    Guest

    Your suggestion not only works great, but I actually got it to work on
    the first try! Thanks very much for your help!
     

Share This Page