Results 1 to 2 of 2

Thread: Checking Option Buttons

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Location
    Lynn, MA
    Posts
    13

    Question Checking Option Buttons

    Do you know if it is possible to loop through specific controls with
    in a frame (instead of " in controls")

    ie...

    Private Sub TestLoop()
    Dim aControl As Control
    Dim fraFrame As Frame

    Set fra = fraSelection

    With fra

    For Each aControl In fra
    If TypeOf aControl Is optionbutton Then
    MsgBox aControl.Text
    End If
    Next

    End With

    End Sub

    In other words, I am trying to loop through specific options buttons inside as specific frame
    besure that the user has selected at least one option (before updating recordset)
    Jake The Dog

  2. #2
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Hi Jay
    You can use the Container property eg...
    VB Code:
    1. Private Sub Command2_Click()
    2.     Dim ctrl As Control
    3.     For Each ctrl In Controls
    4.         If ctrl.Container Is Frame1 Then
    5.             Debug.Print ctrl.Name; " is in frame"
    6.         End If
    7.     Next
    8. End Sub
    regards
    Stuart
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

Posting Permissions

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



Click Here to Expand Forum to Full Width