1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Date calculations

Discussion in 'Software Development' started by clmowers, Apr 7, 2009.

Thread Status:
Not open for further replies.
  1. clmowers

    clmowers Thread Starter

    Joined:
    Jun 20, 2005
    Messages:
    303
    Hello, i have a quick questions. Im building an access database and i need to do some date calculations. Here is the break down of the form

    Form
    textbox1 = Warrenty_Date_expired - Date data type
    textbox2 = Shipped_Date - Date data type
    combo1 = warrenty_length.
    The combo is a number 1-10 in years.

    What i need to do is select a date from txt2 and then select a number from the drop down list and have it add it display it in txt1
    so it should look like this
    txt2 = 4/9/2009
    combo = 1
    txt1 = 4/9/2010
    so its basiclly adding 365 to the date or 730 if 2 is selected and so on

    I have no clue on how to do this. I do know some programming, but for the life of me i cant remember on how to do this. I know i need a variable and need to parse it and all, but i cant remember how....HELP me please
     
  2. draceplace

    draceplace

    Joined:
    Jun 8, 2001
    Messages:
    2,583
    The DateAdd function may get you what you want...my code...
    txt1 = DateAdd("yyyy", 1, txt2) or

    txt1 = DateAdd("yyyy", Combo1, txt2) should work haven't tested

    The "yyyy' indicates year
     
  3. clmowers

    clmowers Thread Starter

    Joined:
    Jun 20, 2005
    Messages:
    303
    Thank you, that did what i needed it to do. Thanks so much that was bugging me. I think i was getting a little more complicated then i needed to. Also i was mixing up my VBA and VB.Net, for some reason i was thinking i needed to parse the data for the calculations.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Date calculations
  1. leachim
    Replies:
    0
    Views:
    131
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/816540

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice