ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   help creating dynamic forms (https://www.excelbanter.com/excel-programming/325152-help-creating-dynamic-forms.html)

mas

help creating dynamic forms
 
Hello All,

I need help creating a form. I have a list of names that I get from a access
query. The list is not alway going to be the same length or have the same
data. I want to associate a number (1 - 7) with each of the names. How can I
do that dynamically with a form?

Here's what I am looking for:

Name 1 pull down menu with the number 1-7
Name 2 pull down menu with the number 1-7
..
..
..
Name n pull down menu with the number 1-7

I know how to use a ComboBox on forms, but how do I make it dynamic and
place additional ComboBox's dependant upon the number of Name's.

Thanks,



Dick Kusleika[_4_]

help creating dynamic forms
 
mas

I don't understand what the 1-7 means. Is that an example of when you have
seven names? Do you want one combobox for each name? How will you know how
many names there are? You get them from access, but are they in a range or
in a recordset or what?

Generally, the way I do it is to have as many comboboxes on the form as I
could possibly have names. I set all of their Visible properties to False.
In the forms Initialize event, I determine how many boxes I'll need and make
just that many visible.

That works well when the maximum number of boxes isn't far from the median
number of boxes. If you normally need 10 boxes but the maximum is 100, you
might want to create them on the fly so you don't have so many wasted boxes.
On the other hand, if you normally need 10 and the max is 20, just create
them all at design time and use the visible property to show what you need.
To create comboboxes at run time, see here

http://groups-beta.google.com/group/...ceac2c6ba673bb

--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

mas wrote:
Hello All,

I need help creating a form. I have a list of names that I get from a
access query. The list is not alway going to be the same length or
have the same data. I want to associate a number (1 - 7) with each of
the names. How can I do that dynamically with a form?

Here's what I am looking for:

Name 1 pull down menu with the number 1-7
Name 2 pull down menu with the number 1-7
.
.
.
Name n pull down menu with the number 1-7

I know how to use a ComboBox on forms, but how do I make it dynamic
and place additional ComboBox's dependant upon the number of Name's.

Thanks,





All times are GMT +1. The time now is 08:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com