Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Posts
    106

    Unanswered: Please help create control on a form

    Can anyone help please?

    I have a table with a list of program names in the first column. When a button (left-hand side of the form) is pressed, i would like buttons to appear down the right-hand side of the form with the program names on them.

    I have this effect at present by having 20 buttons on the right-hand side with their visible property set to No.

    When the left-hand side button is pressed, i set a SQL recordset and make each button visible, and asign a caption in turn.

    However, the inevitable has happened - The program list has now reached 21. Instead of simply creating more buttons i would like to create each button required in VB (meaning that you can have an infinite amount on the list). Using the CreateControl function, the form has to be in design mode which stops the code from running.

    I have tried creating the control in a module passed to by the form but this won't work either. Can anyone help?

    If this is really confusing, let me know!
    sugarflux

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    Make your choices on another form and when the user clicks the button, then open the other form in the desigen format, add all your desired buttons 21, or 29 then close it and open it normally (run format)

  3. #3
    Join Date
    Aug 2003
    Posts
    106

    Tahnks

    Thanks for this - i will give it a try.

    All of the buttons need to be on the same form as the button that creates the buttons but i will try running the code from another form.

    sugarflux

  4. #4
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    This is the only way, yu can not open the form which you run in the desigen fromat.

Posting Permissions

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