Solved

VBA: how to reset checkboxes inside a frame

Posted on 2009-07-01
3
580 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 500 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

732 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