Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Minneapolis, MN, Minnesota
    Posts
    162
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Text Box Update (ACCESS 2000)

    Could someone place give me some assistance on the following dilemna I am having?
    I have a form that has 2 text box fields on it; datDOB and lngAge. I would like to be able to enter a date in the datDOB field and after update, VB would execute a code to insert the correct age in the lngAge field (todays date - DOB).
    Is this possible and does anyone know how to do this?
    Easy Access

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Text Box Update (ACCESS 2000)

    The essential step is to write a small routine which executes after the text box datDOB has been updated. Since dates can be treated by numbers, all you need to do is set the value of the IngAge textbox to the difference as your formula suggests.
    Wendell

  3. #3
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    Minneapolis, MN, Minnesota
    Posts
    162
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Text Box Update (ACCESS 2000)

    Thanks Wendell, any quick suggestions on how to format that?
    Easy Access

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Text Box Update (ACCESS 2000)

    Well, age is usually represented as an integer - most people don't care that your are 4 months and 3 days past your birthday. So I would simply set the format to integer with no decimals. The result will be a floating point number, but a format on the text box should do the trick.
    Wendell

Posting Permissions

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