Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic/Variable UserForm. Is it possible?

Status
Not open for further replies.

ejens

Technical User
Sep 4, 2007
2
CA
Oops.. originally posted in ACCESS forum...

I am an AutoCAD user who is new to VBA and I am working on a program to generate a block which can contain a range of attributes. from 2 sets to 24 sets.

Is there anyway to make my second UserForm Generate with the proper Number of input boxes based on the user defined value(2-24)? Or do Ihave to create a UserForm for every possibility?

Any help and advice would be appreciated.

Thanks.
ejens
 





Hi,

You could make your 24, then control the Visible property, and even the size of your Userform by the number of visible boxes.

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
While it possible to create controls dynamically, I agree with Skip. It is easier to actually have the controls on the userform and make them visible dynamically. Along with resizing the userform itself to fit.

faq219-2884

Gerry
My paintings and sculpture
 
ejens,

Another approach is to dynamically create your Userform using code. John Walkenbach provides instructions on how to do this on his "The Spreadsheet Page" website. The link to this specific topic is: His example uses OptionButtons but you can modify to work with TextBoxes.

You can also download the example workbook.


Regards,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top