By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,493 Members | 1,214 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,493 IT Pros & Developers. It's quick & easy.

Dynamically created controls

P: n/a
SAM
Hi everyone,

I have actually been successful in creating controls
onto forms on the fly. What I am wondering is if it
is possible to generate VBA code for a particular control
at the same time.

For example, a combobox is created with all the properties
added in code. Then, an event procedure (ie. ON CLICK) is
subsequently generated for that control via code.

I have been able to create a blank form with VBA included
for non-existent controls that can later be pointed to. But,
I'm wondering if it can be done programatically from scratch.

Thanks for any suggestions. SAM
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

"SAM" <ga*********@hotmail.com> wrote in message
news:98**************************@posting.google.c om...
Hi everyone,

I have actually been successful in creating controls
onto forms on the fly. What I am wondering is if it
is possible to generate VBA code for a particular control
at the same time.

For example, a combobox is created with all the properties
added in code. Then, an event procedure (ie. ON CLICK) is
subsequently generated for that control via code.

I have been able to create a blank form with VBA included
for non-existent controls that can later be pointed to. But,
I'm wondering if it can be done programatically from scratch.


Yes, look for help on the insertlines method.

Regards,

Duncan Macarthur
Nov 12 '05 #2

P: n/a

"SAM" <ga*********@hotmail.com> wrote in message
news:98**************************@posting.google.c om...
Hi everyone,

I have actually been successful in creating controls
onto forms on the fly. What I am wondering is if it
is possible to generate VBA code for a particular control
at the same time.

For example, a combobox is created with all the properties
added in code. Then, an event procedure (ie. ON CLICK) is
subsequently generated for that control via code.

I have been able to create a blank form with VBA included
for non-existent controls that can later be pointed to. But,
I'm wondering if it can be done programatically from scratch.


Yes, look for help on the insertlines method.

Regards,

Duncan Macarthur
Nov 12 '05 #3

P: n/a
Hello,
What I do in that situation is to create the controls at
design time, complete with the VBA code to handle events, but I set
the visible property to false. Then, as I need them, I make them
visible.

Write me direct, if you need more help.
Hank Reed
Nov 12 '05 #4

P: n/a
Hello,
What I do in that situation is to create the controls at
design time, complete with the VBA code to handle events, but I set
the visible property to false. Then, as I need them, I make them
visible.

Write me direct, if you need more help.
Hank Reed
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.