Option Groups and updating form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rsteph
    New Member
    • Oct 2006
    • 71

    Option Groups and updating form

    I've got an option group with 5 options, with no default value. Whenever I open the form and scroll through records all of the options are grey'd, unless the user selects one.

    What I would like to do is have the option group display the current value of the options, depending on the record being viewed. So that as you scroll through records whatever option is currently selected (based on the table) for that record is already selected in the option group.

    I've got an if statement setup that *should* handle this, but I'm not sure where to place the code. I've tried to use form_activate() and form_AfterUpdat e(), but niether seems to work. Can anyone help me with where I should put code like this?
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Set the control source of the option group to the field in the table and you won't need any code.

    Comment

    • rsteph
      New Member
      • Oct 2006
      • 71

      #3
      The problem I have there is the way the option group works.

      The field that the option group refers to has to be a text field, but option groups can only return numbers. So I have the option group unbound, and then have an invisible textbox that stores a specified string based on the number returned from the option group.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        What about having a look up table instead and storing the number rather than the text? It'll save you space in the long run with the benefit of making your form simpler. No need for code and you can get rid of that hidden text box.

        Comment

        • rsteph
          New Member
          • Oct 2006
          • 71

          #5
          sorry didn't mean to double post

          Comment

          • rsteph
            New Member
            • Oct 2006
            • 71

            #6
            The way things are set up right now, I've got an option group with 5 options, representing folders where a file is stored. The database is then linked to a webpage, and that field is used along with the name of the file to create a hyperlink to the file.

            One of the options I have is an "other" option, that has a textbox next to it that allows the user to input in a specified folder. That was in the future if we add a new folder to store files in, the form would still work.

            Comment

            • Rabbit
              Recognized Expert MVP
              • Jan 2007
              • 12517

              #7
              Well, the design difficulties aside.

              If your if code works, then you'll need to put it in the after update event of the option group and the on current event of the form.

              Comment

              Working...