Solved

VBA: how to reset checkboxes inside a frame

Posted on 2009-07-01
3
544 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
  • 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now