Results 1 to 3 of 3
  1. #1
    Jojojo is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    46

    If Statement based on Combo Box selection

    I would like to set 1 option in a combo box, that if chosen, makes 1 field = another.



    I have a Bound Text Box called RegistrationDate
    I have an unbound Text Box called RenewalDate, that does a calculation, to calculate what the RenewalDate should be based on the RegistrationDate

    There is only 1 option in a combo box that I want to do anything when selected - that is "Drop In". If the user selects Drop In from the list, it means her client just dropped in for 1 class that day, so I would need to RenewalDate to = the RegistrationDate in that case only.

    I am hoping someone can tell me what the code would look like, and if I have to put it in the "On Change" event of the combo box, or if I can just add this to code that is already in the unbound text box for RenewalDate (which is =DateAdd("ww",[MembershipLength],[RegistrationDate])+[AddDays]) My first thought is it to be an IF statement in the RenewalDate field, that says basically If FeeScheduleID=Drop In, then RenewalDate=RegistrationDate, else (insert above code), but I don't know how to write that properly.

    Thanks!!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Try:
    =IIf([FeeScheduleID]= "Drop In", [RegistrationDate], DateAdd("ww",[MembershipLength],[RegistrationDate])+[AddDays]))
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Jojojo is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    46
    Quote Originally Posted by June7 View Post
    Try:
    =IIf([FeeScheduleID]= "Drop In", [RegistrationDate], DateAdd("ww",[MembershipLength],[RegistrationDate])+[AddDays]))
    Thanks! That worked

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

Similar Threads

  1. Combo Box event based on selection
    By tobydobo in forum Access
    Replies: 52
    Last Post: 01-20-2012, 07:26 PM
  2. Replies: 4
    Last Post: 01-24-2011, 07:11 PM
  3. Visibility based on Combo selection
    By jlclark4 in forum Forms
    Replies: 1
    Last Post: 12-22-2010, 11:42 AM
  4. Replies: 2
    Last Post: 09-17-2010, 09:53 AM
  5. Replies: 1
    Last Post: 08-26-2009, 10:45 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