Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Posts
    395

    Unanswered: option group radio button trouble

    I am trouble with option group radio button.
    I have three radio buttons.
    labels for these buttons are .65, 1.5, 1.5c

    aql_level 'text box
    Frame22 'option group

    When a record is selected in the combo box the text boxes is populated. Then the value from a text box(aql_level) matches to label of the radio button that radio is marked(displayed).

    The code is written in a combo box property afterupdate: Frame22.Value = aql_level.Value

    The option group works with values 1 & 2 but would not display the 3rd value(1.5c). I did a debug and the value is received in Frame22 but option group looks like it has been disabled, it is grayed out.

    Private Sub cboCustParts_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.Find "[part_cost_info_id] = " & Str(Me![cboCustParts])
    Me.Bookmark = rs.Bookmark
    Debug.Print aql_level.Value
    Frame22.Value = aql_level.Value
    Debug.Print Frame10.Value
    End Sub

    The recordsource for the form is a view.

    I'm not quite how radio buttons work. It seems like it's matching the value found from a recordset to the label of the radios, not the index #. Is this correct?

    Any help will be appreciated.

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    radio groups return integer values (or maybe byte or long - who cares!)

    does this help:
    Code:
    Private Sub Frame_AfterUpdate()
        NativeValueTextBox.Value = Frame.Value 'shows 1 or 2 or 3
        Select Case Frame.Value
            Case 1
                ModifiedValueTextBox.Value = "0.65"
            Case 2
                ModifiedValueTextBox.Value = "1.5"
            Case 3
                ModifiedValueTextBox.Value = "1.5c"
        End Select
    End Sub
    izy

  3. #3
    Join Date
    May 2002
    Posts
    395
    Originally posted by izyrider
    radio groups return integer values (or maybe byte or long - who cares!)

    does this help:
    Code:
    Private Sub Frame_AfterUpdate()
        NativeValueTextBox.Value = Frame.Value 'shows 1 or 2 or 3
        Select Case Frame.Value
            Case 1
                ModifiedValueTextBox.Value = "0.65"
            Case 2
                ModifiedValueTextBox.Value = "1.5"
            Case 3
                ModifiedValueTextBox.Value = "1.5c"
        End Select
    End Sub
    izy
    I will see if I could somehow make use of your code. If I don't get to it by tomorrow I will have to wait to next week. Thank you so much for your reply and your assistance.

    Have a good day!

Posting Permissions

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