Welcome to SPN

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

Sign Up Now!

Field Values Using If Else Statements

Discussion in 'Information Technology' started by MJc215, Nov 17, 2005.

  1. MJc215

    MJc215
    Expand Collapse
    Guest

    I want to create a field that has a numeric value that will be
    determined by another already created field called "days out". I want
    the days out field to be worked into an If else statement that will
    enter a value of 1, 2, or 3 based the number of days out field. Can i
    write this directly in the field or should it be done with a function
    that is referenced to the field?????
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Preserving Traditional Sikh Values (Huddersfield Daily Examiner) Breaking News May 9, 2006
    Canada Huddersfield Sikh Community Leader Bakhshish Singh Bhullar Dies Breaking News Jan 27, 2014
    The ‘Flying Sikh’ On India’s Lamentable Track-and-field Prowess Sports & Fitness Oct 4, 2010
    India India Can Never Beat China In Any Field Breaking News May 22, 2010
    US Defense Department Hiring Resident Aliens In Medical And Language Fields Business, Lifestyle & Leisure Dec 6, 2008

  3. OP
    Van T. Dinh

    Van T. Dinh
    Expand Collapse
    Guest

    No.

    In fact, calculated values (and it sounds to me the required numeric value
    you want is a calculated value) should not be stored in the Table according
    to the Relational Database Design Theory. Calculated values should
    generally be (re-) calculated when it is needed and not stored!

    --
    HTH
    Van T. Dinh
    MVP (Access)



    "MJc215" <buttauup1@gmail.com> wrote in message
    news:1132175619.273523.10020@g44g2000cwa.googlegroups.com...
    >I want to create a field that has a numeric value that will be
    > determined by another already created field called "days out". I want
    > the days out field to be worked into an If else statement that will
    > enter a value of 1, 2, or 3 based the number of days out field. Can i
    > write this directly in the field or should it be done with a function
    > that is referenced to the field?????
    >
     
  4. OP
    tina

    tina
    Expand Collapse
    Guest

    well, unless there is a direct 1 to 1 correlation between [days out] and the
    assigned value (1 [days out] = 1 [assigned value], 2 [days out] = 2
    [assigned value], etc), i would probably use a Select Case statement. for
    example

    Select Case Me![days out]
    Case 1 To 5
    Me![days out] = 1
    Case 6 To 10
    Me![days out] = 2
    Case Is > 10
    Me![days out] = 3
    Case Else
    Me![days out] = 0
    End Select

    you might run the code from the [days out] control's AfterUpdate event
    procedure.

    hth


    "MJc215" <buttauup1@gmail.com> wrote in message
    news:1132175619.273523.10020@g44g2000cwa.googlegroups.com...
    > I want to create a field that has a numeric value that will be
    > determined by another already created field called "days out". I want
    > the days out field to be worked into an If else statement that will
    > enter a value of 1, 2, or 3 based the number of days out field. Can i
    > write this directly in the field or should it be done with a function
    > that is referenced to the field?????
    >
     
Since you're here... we have a small favor to ask...     Become a Supporter      ::     Make a Contribution     


Share This Page