Subform Option box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stardrifter
    New Member
    • Jul 2008
    • 2

    Subform Option box

    Hello :)
    I have option boxes that return text values in a subform with a one on one relationship between main form and subform (contract number). Everything seems to work ok, and values are returned to the table as they should be, however when I use the option boxes on one subform it changes the option boxes on all subforms (without recording the values on the other forms ) >.< its driving me nuts!

    Any sugestions greatfully appreciated!

    keep smiling
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    You did not provide much info to go on, but it sounds like you created "dependent" option boxes, in which the row source of each of the option boxes references the row source of another combobox. Then when the combobox that has focus is requeried, the row sources of any comboboxes that are dependent on that combobox are updated. You need to post the row source of your comboboxes and any code that you have in the AfterUpdate Event of each combobox.

    Comment

    • stardrifter
      New Member
      • Jul 2008
      • 2

      #3
      Hey :) thanks for replying!

      Here is the code I've used.. there are 5 option groups in the subform that return text values. This is the code I've used

      Private Sub optCourseware_A fterUpdate()
      Me!Courseware = Choose(Me!optCo urseware, "Generic courseware badged", "Courseware being developed", "Courseware already exists", "Not applicable")
      End Sub

      and the Subform OnCurrent event

      Private Sub Form_Current()
      Select Case Me!Courseware
      Case "Generic courseware badged"
      Me!optCoursewar e = 1
      Case "Courseware being developed"
      Me!optCoursewar e = 2
      Case "Courseware already exists"
      Me!optCoursewar e = 3
      Case "Not applicable"
      Me!optCoursewar e = 4
      Case Else
      Me!Courseware = Null
      End Select

      There is a one-to-one relationisip between Contract numbe on the main form and contract number on the subform.

      When I choose options the text value is returned to the table for that contract but all the dots in the option boxes through all the records change to read the same (though those values are not returned to the table for the other records)

      Does that make sense..

      anyway all help greatfully received!

      : )

      Comment

      • puppydogbuddy
        Recognized Expert Top Contributor
        • May 2007
        • 1923

        #4
        OK, seeing your code helps...you've got an option group with 4 option buttons. I believe your problem is on this line:

        Case Else
        Me!Courseware = Null

        Set the default value in the option group = 0 (don't add an option button) and change the above code to:

        Case Else
        Me!Courseware = 0

        Let me know what happens.

        Comment

        • puppydogbuddy
          Recognized Expert Top Contributor
          • May 2007
          • 1923

          #5
          PS:
          Another alternative might be: Leave everything as you had it originally, except change the code to:

          Case Else
          Me!Courseware = ""

          Comment

          Working...