Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-31-2022, 04:15 AM
JamesMWood JamesMWood is offline Why is control not defined? Windows 10 Why is control not defined? Office 2021
Novice
Why is control not defined?
 
Join Date: May 2022
Posts: 25
JamesMWood is on a distinguished road
Question Why is control not defined?

Hi there

I'm working on a simple macro where a button clears all checkboxes. Any reason why Visual Studio is saying "Type 'Control' is not defined" and "Typed 'CheckBox' is not defined" ?

Private Sub ClearSelection_Click(sender As Object, e As EventArgs) Handles ClearSelection.Click


For Each ctrl As Control In Me.Controls
If TypeOf ctrl Is CheckBox Then
DirectCast(ctrl, CheckBox).CheckState = CheckState.Unchecked
End If
Next
End Sub

Thanks a lot
James
Reply With Quote
 

Tags
checkbox

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why is control not defined? FileSystemObject Compile Error: User-Defined Type Not Defined gsrikanth Excel Programming 2 03-28-2022 06:32 AM
Why is control not defined? Application Defined or Object defined error bennyamy Excel Programming 4 03-23-2017 11:42 AM
Why is control not defined? User-defined Type not Defined VBA Issue OTPM Project 3 01-02-2014 01:47 PM
Why is control not defined? Range.Information(wdStartOfRangeRowNumber): Application-defined or Object-defined err tinfanide Excel Programming 2 06-09-2012 10:19 AM
Why is control not defined? Application-defined or Object-defined error Manit Excel Programming 4 12-08-2011 07:35 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:17 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft