PC Review


Reply
Thread Tools Rate Thread

convert object name from string to object

 
 
=?Utf-8?B?VGFtYXI=?=
Guest
Posts: n/a
 
      18th Apr 2007
Hi can anybody help me with this problem:

I have a function that expects the following:

Public Sub CheckFrame(ByRef ThisFrame As MSForms.Frame)

I would like to call this Sub in a loop foor frames with names FrameQ1,
FrameQ2 untill 22.

so:

for i = 1 to 22
CheckFrame Cstr("Me.FrameQ" & i)
next i

but this doesn't work because the sub expects a frame object and not a
string. But how can i change string such that the sub will treat it as the
Frame object?

I really hope you can help me out here...

kind regards,

Tamar


 
Reply With Quote
 
 
 
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      18th Apr 2007
Tamar,

Try it this way:

For i = 1 To 22
CheckFrame Me.Controls("FrameQ" & i)
Next i


--
Hope that helps.

Vergel Adriano


"Tamar" wrote:

> Hi can anybody help me with this problem:
>
> I have a function that expects the following:
>
> Public Sub CheckFrame(ByRef ThisFrame As MSForms.Frame)
>
> I would like to call this Sub in a loop foor frames with names FrameQ1,
> FrameQ2 untill 22.
>
> so:
>
> for i = 1 to 22
> CheckFrame Cstr("Me.FrameQ" & i)
> next i
>
> but this doesn't work because the sub expects a frame object and not a
> string. But how can i change string such that the sub will treat it as the
> Frame object?
>
> I really hope you can help me out here...
>
> kind regards,
>
> Tamar
>
>

 
Reply With Quote
 
=?Utf-8?B?VGFtYXI=?=
Guest
Posts: n/a
 
      18th Apr 2007
Hi Vergel,

Thanx a lot for your fast response, your solution works!

kind regards

Tamar

"Vergel Adriano" wrote:

> Tamar,
>
> Try it this way:
>
> For i = 1 To 22
> CheckFrame Me.Controls("FrameQ" & i)
> Next i
>
>
> --
> Hope that helps.
>
> Vergel Adriano
>
>
> "Tamar" wrote:
>
> > Hi can anybody help me with this problem:
> >
> > I have a function that expects the following:
> >
> > Public Sub CheckFrame(ByRef ThisFrame As MSForms.Frame)
> >
> > I would like to call this Sub in a loop foor frames with names FrameQ1,
> > FrameQ2 untill 22.
> >
> > so:
> >
> > for i = 1 to 22
> > CheckFrame Cstr("Me.FrameQ" & i)
> > next i
> >
> > but this doesn't work because the sub expects a frame object and not a
> > string. But how can i change string such that the sub will treat it as the
> > Frame object?
> >
> > I really hope you can help me out here...
> >
> > kind regards,
> >
> > Tamar
> >
> >

 
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
Re: Convert a string to an object. John W. Vinson Microsoft Access Form Coding 0 12th Apr 2010 09:45 PM
Convert string to object Mat Child Microsoft Access Forms 2 10th Aug 2009 07:09 AM
Connection String object Convert to String Variable Type =?Utf-8?B?TWlrZSBNb29yZQ==?= Microsoft ASP .NET 2 26th Oct 2004 03:43 PM
Convert object[] to string[] Webgour Microsoft C# .NET 1 30th Jul 2004 12:22 AM
Re: Convert String to Object or Method Herfried K. Wagner [MVP] Microsoft VB .NET 0 24th Mar 2004 04:39 PM


Features
 

Advertising
 

Newsgroups
 


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