Results 1 to 5 of 5
  1. #1
    Suoipoc is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2011
    Posts
    4

    Command Button DateAdd

    I have a form with a command button and I need it to insert the current date + 3 months. So if today is 1/1/11 I need it to insert the date 3/1/11. This date field does not always need the advanced date, sometimes it will be manually entered as a different date, so having a query auto add to the date will not work. I need it to be in my form.



    This is what I currently have as an event procedure: [Forms]![ContactDetails]![NxtCntact] = DateAdd(month, 3, Date)
    Can Someone please help me.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    What exactly do you want? You said you had a button, and associated with it is a Click event. However, you want it somehow to know when the Click is real and another somehow to know the Click is just a signal to do some manual activity.

    I think you need to decide what criteria is needed to use Date + 3 Months, AND
    what exactly are the conditions to do a manual insertion of a Date.

    We can't guess what triggers these. You will have to determine the criteria, tell us, and hopefully someone can help.

  3. #3
    Suoipoc is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2011
    Posts
    4
    I’m sorry that I was not specific enough. There is a command button, and there is a date field, the user can choose to click on the command button in order to insert the date +3months or they can click on the date field and manually enter. Either way, it is a manual operation. The user clicks either the command button or the date field. I just need to know how upon “click” to make it insert date + 3months. I have several command buttons that insert Date(), but beyond that I’m at a loss.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    see http://www.techonthenet.com/access/f...te/dateadd.php

    for use and syntax of DateAdd function

  5. #5
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Quote Originally Posted by Suoipoc View Post
    ... There is a command button, and there is a date field, ...
    The rough idea and command goes here:

    Code:
    Private sub Command1_Click()
    YourDateFieldOnTheForm.Value= YourDateFieldOnTheForm + 30
    End sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Command Button
    By BLD21 in forum Access
    Replies: 2
    Last Post: 05-02-2011, 04:47 PM
  2. Replies: 1
    Last Post: 07-27-2010, 02:27 PM
  3. Command Button
    By nashr1928 in forum Forms
    Replies: 2
    Last Post: 07-05-2010, 08:02 PM
  4. Command Button
    By nashr1928 in forum Forms
    Replies: 1
    Last Post: 07-05-2010, 07:05 PM
  5. Command Button
    By lannoe in forum Forms
    Replies: 1
    Last Post: 07-01-2010, 01:48 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums