Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VBA: how to reset checkboxes inside a frame

Posted on 2009-07-01
3
Medium Priority
?
627 Views
Last Modified: 2013-11-26
Hi x-perts,

is there a way to reset ALL checkboxes inside of a frame?

Thanks
0
Comment
Question by:andy7789
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 total points
ID: 24775269
Hi there,

I haven't tested these options, but you can either of the two below.

Regards,

Rob.
' Option 1
    Dim ckBox As OLEObject
    For Each ckBox In MyForm.MyFrame.OLEObjects
        If TypeName(ckBox) ="CheckBox" Then ckBox.Object.Value = 0
    Next ckBox
 
'Option 2
For Each objControl In MyForm.MyFrame.Controls 
    If TypeName(objControl) ="CheckBox" Then 
        ckBox.Object.Value = 0
    End If 
Next ctl 

Open in new window

0
 

Author Comment

by:andy7789
ID: 24778228
Thanks, Rob,

none of your versions worked, but this is a slightly modified one that makes its job:

Cheers,

Andy
For Each objControl In Me.Frame2.Controls
    If TypeName(objControl) = "CheckBox" Then
       objControl.Value = 0
   End If
Next objControl

Open in new window

0
 
LVL 65

Expert Comment

by:RobSampson
ID: 24778502
Oh yeah, typo in my option 2....sorry about that.

Thanks for the grade.

Regards,

Rob.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question