Welcome to SPN

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

Sign Up Now!
  1. Monthly (Recurring) Target: $300 :: Achieved: $95
      Become a Supporter    ::   Make a Contribution   

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...


  3. 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. 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...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page