Age Group

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lolodede
    New Member
    • Apr 2009
    • 63

    Age Group

    When the Microsoft Access start it should automatically pick up the system date and update members’ age groups correctly in the form . For example if a person’s date of birth was yesterday and they turned 45 years old then the system would update their agegroup from 40 to 45.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    nothing happens automatically you need to code that.

    Comment

    • lolodede
      New Member
      • Apr 2009
      • 63

      #3
      i know that but i dont know how to put code there i know the formula is If
      age= age/5
      if mod!=0 then age- module
      but i dont know how to start the code in microsoft access form
      i put three text box in my form
      age, DOB , agegroup
      any help well be great

      Comment

      • JennDub
        New Member
        • Oct 2009
        • 5

        #4
        lolodede,
        You could do this a couple of ways: either place the code to calculate the age group in an Event (On_Open for a continuous form displaying multiple records at once or On_Current if you are displaying one record at a time) to update the displayed value in "Age Group" or create a non-visible calculated field for each record (place the age calculation using System Date vs. DOB in it) and run the "Age Group" off of that using its value as your criteria.

        ~JennDub
        Last edited by JennDub; Oct 8 '09, 01:34 PM. Reason: corrected typo

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32633

          #5
          I'm going to move this to the Access forum as it's an Access question.

          JennDub has explained how to do this - Use a calculation either in the underlying query or in the control on the form.

          Let us know how you get on with this.

          Comment

          • lolodede
            New Member
            • Apr 2009
            • 63

            #6
            thanks for help alot but i dint know how to get value of textbox (age) to use it into another textbox(agegrou p) and i dont know how to start this code because im biginner in vba and microsoft access forms
            thanks

            Comment

            • FishVal
              Recognized Expert Specialist
              • Jun 2007
              • 2656

              #7
              A similar thread .

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32633

                #8
                Originally posted by lolodede
                thanks for help alot but i dint know how to get value of textbox (age) to use it into another textbox(agegrou p) and i dont know how to start this code because im biginner in vba and microsoft access forms
                thanks
                Well, why don't you start by telling us what you have so far. Try to be as precise as possible, and to include everything that is related to this issue. It's hard to help with details when we don't know names of things like tables and fields that are involved.

                The less you miss out of what we need the fewer times we'll have to ask for it.

                Comment

                • lolodede
                  New Member
                  • Apr 2009
                  • 63

                  #9
                  thanks for help but i figure out i need to use vba and if statement and everything is working
                  thanks again

                  Comment

                  Working...