Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2006
    Posts
    15

    Unanswered: True/False on option groups

    I have a form that amoung other things has 2 different option groups on them. Is there a way I can put something like a true/false option on them. What I need is for the user to make sure that they have selected an option in each option group before saving and closing the form. If they haven't selected an option I would like to get a message box or error message to come up to tell them to select an option before they can save and exit. Figured the easiest way would be something like a true/false clause to say if option group selected = true then save else display error message. Any help would be appreciated thanks.

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Hopefully, you have a "validate" function before you save your data.
    Somewhere in there, you need to do something like this

    Code:
    ...
    If Me!optGrp1=Null Then
         MSGBOX ....
         Exit Function
    End If
    If Me!optGrp2=Null Then
         MSGBOX ....
         Exit Function
    End If
    ...
    Inspiration Through Fermentation

  3. #3
    Join Date
    Jul 2006
    Posts
    15
    I don't have any validation in place. Am I meant to validate the option group? When I select the option group and go properties I only get the frame, is that what i want?

  4. #4
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Then I'm going to assume your form is "bound" to the table/query.
    If you want your user to chose a value in your option boxes before leaving
    the form, go into the table, and set the "Required" property of the fields that those option boxes are bound to to "Yes". Then, if they add a new record, and forget to select a value in each option group, they will get a
    message like ".... is a required field".
    Inspiration Through Fermentation

  5. #5
    Join Date
    Jul 2006
    Posts
    15
    Thanks for that, works great.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •