Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004

    Unanswered: dynamically add options to a optiongroup


    Could someone please provide me instructions how to dynamically create an optiongroup based on a query on a single table that adds options for each record retrieved ?
    Do you think this will be difficult to accomplish?
    Thanks in advance!!


  2. #2
    Join Date
    Mar 2004
    Make a dynamic form. Here is the general procedure:

    1) Make your form

    2) Add an option button. Set its index value to 0. Set its visible property to false.

    3) Now when you cycle through your recordset add as many option buttons as you need (you will also have to adjust the left and Top properties or all new option buttons will be where the first one is).


    For iCounter = 1 To rsData.RecordCount - 1
    Load OptionButton(iCounter)
    OptionButton(iCounter).Caption= "OptionButton" & iCounter
    'OptionButton(iCounter).Left =
    'OptionButton(iCounter).Top =
    OptionButton(iCounter).Visible= True
    Next iCounter

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

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