date or value based on checkbox?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Darla123
    New Member
    • Aug 2015
    • 26

    #1

    date or value based on checkbox?

    Hello, I have a report that pulls a date from a query, but they'd like an option where if they don't want to enter the date, they can check one of 2 checkboxes. Check box 1 would return "N/A" and checkbox 2 would return "TBD"
    I'm not sure how to accomplish this? I've never had to do anything with more than 1 checkbox. Is it possible? I'm 100% comfortable with access but this has fallen to me.
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    It sounds like an option group would be better unless you want to be able to check both checkboxes.

    Comment

    • Darla123
      New Member
      • Aug 2015
      • 26

      #3
      I'm not sure what an option group is, I'll watch some youtube videos and come back if I have questions......

      Comment

      • Seth Schrock
        Recognized Expert Specialist
        • Dec 2010
        • 2965

        #4
        An option group is a group of radio buttons or checkboxes that only allows one to be selected at a time. The option group then gets its value based on the option selected. You would then use this in a select case to see which option you want to return.

        Comment

        • Darla123
          New Member
          • Aug 2015
          • 26

          #5
          I've got this working a little bit, but is there a way to not have this option group be required? We only require the text box, or 1 of the 2 options. If a user accidentally checks a box from the option group, there's no way to unselect it that I see?

          Comment

          • Seth Schrock
            Recognized Expert Specialist
            • Dec 2010
            • 2965

            #6
            You can either add another option to your option group that specifies to uncheck all options or create a button to uncheck the options. Either way, the code would be
            Code:
            Me.OptionGroupName = ""

            Comment

            • Darla123
              New Member
              • Aug 2015
              • 26

              #7
              This is all working, thank you Seth!

              Comment

              • Seth Schrock
                Recognized Expert Specialist
                • Dec 2010
                • 2965

                #8
                Glad to be of assistance. Good luck on your project.

                Comment

                • Darla123
                  New Member
                  • Aug 2015
                  • 26

                  #9
                  Thanks, I'll be putting another question in before the day is over :)

                  Comment

                  Working...