+ Reply to Thread
Results 1 to 2 of 2

Generate multiple OptionButtons with combobox selection

Hybrid View

  1. #1
    Registered User
    Join Date
    12-18-2008
    Location
    Sydney, Australia
    Posts
    94

    Generate multiple OptionButtons with combobox selection

    Hi there,

    Im trying to create a form that people can use out at site to automatically populate the documents they require based on the section they are in and activities they undertake within their relevant section. This tool will then be used as a hazard identification form and training record form (all good here as this is failry basic programming that i am familiar with).

    I have created the Service Delivery Area and Section combo boxes to work off each other so when you select a certain area it brings up all sections within that. No issues there. What i now want to do is create check boxes (through OptionButton) based on the section and the activities they undertake. For example:

    Service Delivery Area may be called EPAM. Within EPAM there are 4 sections being Environmental Planning & Management, Air, Noise & Greenhouse Gas, Contaminated Lands and Communications. Each section then has its own activity types and vary from 4 activities to 10! Im having issues working out how to list all of the activties based on the section. Not in a combobox but as unique line items.

    From this, i want to be able to checkbox the activity that the section is doing on the day (as they may only do a small percentage of what is listed) which will then automatically hyperlink to the relevan work procedure for that activity.

    Sample is attached with further content / questions / ideas of what i need the document to do. I have also included a sample work procedure.

    Any help you can provide would be greatly appreciated - as im not sure im being to over zealous of what excel can do!

    Cheers ... fmluder93

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Generate multiple OptionButtons with combobox selection

    Here's a simple example of creating userform controls on the fly .. Set up a userform with a combobox and commandbutton.

    Private Sub CommandButton1_Click()
     Dim cCont As Control
     Dim strControl As String
     
     If ComboBox1.ListIndex > -1 Then
      strControl = "Forms." & ComboBox1 & ".1"
     End If
     
     Set cCont = Me.Controls.Add(strControl, "CopyOf")
     
    End Sub
     
    
    Private Sub UserForm_Initialize()
    With ComboBox1
            .AddItem "CheckBox"
            .AddItem "CommandButton"
            .AddItem "TextBox"
            .AddItem "ToggleButton"
        End With
    End Sub
    Of course you'll also need to set the position properties of strContol and then delete them after use
    Elegant Simplicity............. Not Always

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1