PC Review


Reply
Thread Tools Rate Thread

Checkbox - Source types

 
 
=?Utf-8?B?Sk1heQ==?=
Guest
Posts: n/a
 
      26th Jun 2007
I'm working with some code that

Controls.Add("Forms.Checkbox.1")

What does the word "Forms" above indicate?

I know there are the controls which are created on a sheet-only via Toolbar
Forms;
There are also controls from the Control toolbar (onsheet or Userform
-Active Xtype).

Then sometimes I see in Code "MSForms"... How can I better understand and
figure these things out? Help!!
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9lbA==?=
Guest
Posts: n/a
 
      26th Jun 2007
Forms is the name of the userform where the checkbox is located. If the
checkbox is on a worksheet, then you need to add a tool bar as follows:View -
toolbars - Control Toolbox. Then enter design mode and select properties.
Then click on the userform to see the properties.


User forms can also be added in VBA. In the project managger window you can
insert a userform. If a userform exists the to view the userforms in VBA
click on userform in the project manager window.

"JMay" wrote:

> I'm working with some code that
>
> Controls.Add("Forms.Checkbox.1")
>
> What does the word "Forms" above indicate?
>
> I know there are the controls which are created on a sheet-only via Toolbar
> Forms;
> There are also controls from the Control toolbar (onsheet or Userform
> -Active Xtype).
>
> Then sometimes I see in Code "MSForms"... How can I better understand and
> figure these things out? Help!!

 
Reply With Quote
 
=?Utf-8?B?Sk1heQ==?=
Guest
Posts: n/a
 
      26th Jun 2007
Thanks Joel..
Userform1 is the name of my userform, not forms...??

With UserForm1
.Controls.Add ("forms.Checkbox.1")
With .Controls("Checkbox" & i)
.Left = 20
.Top = X * i
.Width = 80
.Height = 25
.Caption = myarray(i)
End With
End With



"Joel" wrote:

> Forms is the name of the userform where the checkbox is located. If the
> checkbox is on a worksheet, then you need to add a tool bar as follows:View -
> toolbars - Control Toolbox. Then enter design mode and select properties.
> Then click on the userform to see the properties.
>
>
> User forms can also be added in VBA. In the project managger window you can
> insert a userform. If a userform exists the to view the userforms in VBA
> click on userform in the project manager window.
>
> "JMay" wrote:
>
> > I'm working with some code that
> >
> > Controls.Add("Forms.Checkbox.1")
> >
> > What does the word "Forms" above indicate?
> >
> > I know there are the controls which are created on a sheet-only via Toolbar
> > Forms;
> > There are also controls from the Control toolbar (onsheet or Userform
> > -Active Xtype).
> >
> > Then sometimes I see in Code "MSForms"... How can I better understand and
> > figure these things out? Help!!

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      26th Jun 2007
Record a macro when you add a checkbox from the forms toolbar to a worksheet.
Then continue recording when you add a checkbox from the Control toolbox
toolbar.

Then look at the code. You'll see that the "Forms.checkbox.1" is used to
indicate the ActiveX version of the checkbox. That's the same type of controls
that are used in UserForms.

And if you see something like:

dim Oleobj as oleobject
with activesheet
for each Oleobj in .oleobjects
if typeof oleobj.object is msforms.checkbox 'ok
as opposed to
if typeof oleobj.object is checkbox 'won't work ok

A plain old checkbox is from the Forms toolbar. The msforms.checkbox is from
the control toolbox toolbar. The code is specifying which checkbox to compare
with.





JMay wrote:
>
> I'm working with some code that
>
> Controls.Add("Forms.Checkbox.1")
>
> What does the word "Forms" above indicate?
>
> I know there are the controls which are created on a sheet-only via Toolbar
> Forms;
> There are also controls from the Control toolbar (onsheet or Userform
> -Active Xtype).
>
> Then sometimes I see in Code "MSForms"... How can I better understand and
> figure these things out? Help!!


--

Dave Peterson
 
Reply With Quote
 
=?Utf-8?B?Sk1heQ==?=
Guest
Posts: n/a
 
      26th Jun 2007
Thanks Dave.
I have printed-off your explanation and will go through word for word.
You have made things much clearer.
Jim

"Dave Peterson" wrote:

> Record a macro when you add a checkbox from the forms toolbar to a worksheet.
> Then continue recording when you add a checkbox from the Control toolbox
> toolbar.
>
> Then look at the code. You'll see that the "Forms.checkbox.1" is used to
> indicate the ActiveX version of the checkbox. That's the same type of controls
> that are used in UserForms.
>
> And if you see something like:
>
> dim Oleobj as oleobject
> with activesheet
> for each Oleobj in .oleobjects
> if typeof oleobj.object is msforms.checkbox 'ok
> as opposed to
> if typeof oleobj.object is checkbox 'won't work ok
>
> A plain old checkbox is from the Forms toolbar. The msforms.checkbox is from
> the control toolbox toolbar. The code is specifying which checkbox to compare
> with.
>
>
>
>
>
> JMay wrote:
> >
> > I'm working with some code that
> >
> > Controls.Add("Forms.Checkbox.1")
> >
> > What does the word "Forms" above indicate?
> >
> > I know there are the controls which are created on a sheet-only via Toolbar
> > Forms;
> > There are also controls from the Control toolbar (onsheet or Userform
> > -Active Xtype).
> >
> > Then sometimes I see in Code "MSForms"... How can I better understand and
> > figure these things out? Help!!

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      26th Jun 2007
Well, that may not last after you actually read it <vbg>.

Just remember everything has to be able to be uniquely identified.

Range("a1")
could be
worksheets("sheet999").range("a1")
could be
workbooks("book888.xls").worksheets("sheet999").range("a1")
could be
Application.workbooks("book888.xls").worksheets("sheet999").range("a1")

And excel has some objects that share a common name--like Checkbox, Listbox...


JMay wrote:
>
> Thanks Dave.
> I have printed-off your explanation and will go through word for word.
> You have made things much clearer.
> Jim
>
> "Dave Peterson" wrote:
>
> > Record a macro when you add a checkbox from the forms toolbar to a worksheet.
> > Then continue recording when you add a checkbox from the Control toolbox
> > toolbar.
> >
> > Then look at the code. You'll see that the "Forms.checkbox.1" is used to
> > indicate the ActiveX version of the checkbox. That's the same type of controls
> > that are used in UserForms.
> >
> > And if you see something like:
> >
> > dim Oleobj as oleobject
> > with activesheet
> > for each Oleobj in .oleobjects
> > if typeof oleobj.object is msforms.checkbox 'ok
> > as opposed to
> > if typeof oleobj.object is checkbox 'won't work ok
> >
> > A plain old checkbox is from the Forms toolbar. The msforms.checkbox is from
> > the control toolbox toolbar. The code is specifying which checkbox to compare
> > with.
> >
> >
> >
> >
> >
> > JMay wrote:
> > >
> > > I'm working with some code that
> > >
> > > Controls.Add("Forms.Checkbox.1")
> > >
> > > What does the word "Forms" above indicate?
> > >
> > > I know there are the controls which are created on a sheet-only via Toolbar
> > > Forms;
> > > There are also controls from the Control toolbar (onsheet or Userform
> > > -Active Xtype).
> > >
> > > Then sometimes I see in Code "MSForms"... How can I better understand and
> > > figure these things out? Help!!

> >
> > --
> >
> > Dave Peterson
> >


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what types of source data can't be grouped in pivottable Group items in a PivotTable Microsoft Excel Misc 0 2nd Sep 2009 10:31 AM
row source types article 233274 dennis Microsoft Access Forms 0 25th Mar 2008 06:32 AM
Source and Destination Folders have different types of items Patty Microsoft Outlook 1 24th Mar 2008 06:56 PM
How can I create new source types in Word 2007? =?Utf-8?B?VGVk?= Microsoft Word Document Management 0 30th Jun 2007 06:30 PM
Bind Checkbox to a data source ? JezB Microsoft Dot NET Framework Forms 1 2nd Apr 2004 05:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:09 PM.