How to create controls at runtime

  • Thread starter Thread starter Andy Chan
  • Start date Start date
A

Andy Chan

I want to create a list of checkboxes at runtime.

What is the best way to do it ?
I used the following

Dim ctlName As Control
Set ctlName = Controls.Add("Forms.Checkbox.1", True)

It works, but how do i add a name for the checkbox ? There
is no text or caption method that goes along with it.

Thanks
 
Hi Vasant,

The name does not appear on the form. Why is this so ?

Regards,
Andy
 
You need

ctlName.Caption="Andy"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top