Results 1 to 3 of 3
  1. #1
    CiaranP is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2015
    Posts
    2

    Combo Box / option buttons to set variables for a date

    Hi,



    I'm looking to have either a combo box,, or 2 options buttons (whichever is easiest) that set a date field based on what is selected in the combo box/ option buttons.

    The variables are 'Payment in 30 days" " Payment upfront"

    if "payment in 30 days" is selected the date field on the form will enter the date as + 30 days from todays date
    if "payment upfront" is selected the field on the form will enter todays date.

    This date field must be blank unless an option is selected, as this information is only entered in a later stage of the form.

    I've tried a few different ways to enter this but i can't quite get it to work as i want.
    I hope someone can help me with this.

    Thanks.

    Ciaran

  2. #2
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    you could put the following in the combobox afterupdate event

    Code:
    select case mycombo
        case "Payment in 30 days"
            mydate=dateadd("d",30,date())
        case " Payment upfront"
            mydate=date()
        case else
            mydate=null
    end select

  3. #3
    CiaranP is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2015
    Posts
    2
    Thank you!

    Had to add 2 more cases but that is spot on. Thanks again for your response

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

Similar Threads

  1. Option Buttons
    By Cyber27uk in forum Access
    Replies: 1
    Last Post: 01-10-2013, 03:45 PM
  2. Option buttons
    By Ecal in forum Programming
    Replies: 2
    Last Post: 11-11-2012, 09:04 AM
  3. Use of option group buttons
    By sireesha in forum Forms
    Replies: 1
    Last Post: 10-25-2012, 01:20 PM
  4. How too use check boxes and option buttons
    By newtoAccess in forum Forms
    Replies: 0
    Last Post: 12-03-2010, 04:41 PM
  5. Option buttons
    By chazcoral2 in forum Forms
    Replies: 11
    Last Post: 09-13-2010, 07:53 AM

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