PC Review


Reply
Thread Tools Rate Thread

Controls Array

 
 
=?Utf-8?B?Unlhbkg=?=
Guest
Posts: n/a
 
      13th Nov 2007
Can you have an Array of Controls that are located in different Frames on a
UserForm? Here is the code that I have and I am getting an Run Time Error:
Type Mismatch.

For Each Control In Controls(Array("cboAreaP", "cboAreaV", "cboAreaD", _
"cboSingle", "cboDouble",
"cboDebossed"))
With Control
.AddItem "25%"
.AddItem "50%"
.AddItem "75%"
.AddItem "100%"
End With
Next Control
 
Reply With Quote
 
 
 
 
Rick Rothstein \(MVP - VB\)
Guest
Posts: n/a
 
      13th Nov 2007
> Can you have an Array of Controls that are located in different Frames on
> a
> UserForm? Here is the code that I have and I am getting an Run Time
> Error:
> Type Mismatch.
>
> For Each Control In Controls(Array("cboAreaP", "cboAreaV", "cboAreaD", _
> "cboSingle", "cboDouble",
> "cboDebossed"))
> With Control
> .AddItem "25%"
> .AddItem "50%"
> .AddItem "75%"
> .AddItem "100%"
> End With
> Next Control


Try your For Each statement this way and see if that works...

For Each Control In Array(cboAreaP, cboAreaV, cboAreaD, _
cboSingle, cboDouble, cboDebossed)

Rick

 
Reply With Quote
 
Nigel
Guest
Posts: n/a
 
      13th Nov 2007
Try something like this.......on UserForm code sheet

For Each C In Array("cboAreaP", "cboAreaV", "cboAreaD", "cboSingle",
"cboDouble", "cboSingle", "cboDouble","cboDebossed")
With Me.Controls(C)
.AddItem "25%"
.AddItem "50%"
.AddItem "75%"
.AddItem "100%"
End With
Next

--

Regards,
Nigel
(E-Mail Removed)



"RyanH" <(E-Mail Removed)> wrote in message
news:92242623-4132-4380-B7F9-(E-Mail Removed)...
> Can you have an Array of Controls that are located in different Frames on
> a
> UserForm? Here is the code that I have and I am getting an Run Time
> Error:
> Type Mismatch.
>
> For Each Control In Controls(Array("cboAreaP", "cboAreaV", "cboAreaD", _
> "cboSingle", "cboDouble",
> "cboDebossed"))
> With Control
> .AddItem "25%"
> .AddItem "50%"
> .AddItem "75%"
> .AddItem "100%"
> End With
> Next Control


 
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
Array of controls =?Utf-8?B?eW9uaW5h?= Microsoft Access Forms 1 6th Mar 2006 03:46 PM
An array of controls =?Utf-8?B?U2hlbGRvbg==?= Microsoft VB .NET 3 7th Feb 2005 02:46 PM
Controls Array =?Utf-8?B?SmF2aQ==?= Microsoft Dot NET Compact Framework 1 6th May 2004 12:58 PM
How do I Dim an Array of Controls? Sandy S. Microsoft Access Form Coding 2 20th Mar 2004 02:08 AM
Controls Array kotayya Microsoft Dot NET Framework 2 6th Sep 2003 08:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:06 AM.