473,385 Members | 1,325 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Need help in VBA code of looping through controls

176 100+
Hi All.
I'm trying to delete conditions from all the controls in my form via VBA command. This code doesn't work though:

Expand|Select|Wrap|Line Numbers
  1. Dim frm As Form
  2. Dim myControl As Control
  3.  
  4. Set frm = Forms!Customers
  5.  
  6. For Each myControl In frm.Controls  'I also tried myControl in frm
  7.       myControl.FormatConditions.Delete
  8. Next
Anyone knows whats wrong?
Thanks.
Feb 13 '07 #1
1 2016
MMcCarthy
14,534 Expert Mod 8TB
Try this ...


Expand|Select|Wrap|Line Numbers
  1. Dim frm As Form
  2. Dim myControl As Control
  3.  
  4.   Set frm = Forms!Customers
  5.  
  6.   For Each myControl In frm.Controls  'I also tried myControl in frm
  7.     myControl.Format = Null
  8.   Next
  9.  
  10.  
Feb 14 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ivo | last post by:
Hi, I have an audio file (.mid or .wav or .mp3) in an object element: <object id="snd" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"...
4
by: Viper | last post by:
Is there a way to access a control on a form directly by name? I've used the code shown below but it requires looping through each control on the form and seems a bit inefficient. I know...
2
by: theComputer7 | last post by:
I cut down the code to make this half way understandable... I have read Data Grid girls caution about over use of dynamic controls. I truly believe what I am doing requires dynamically inserted...
2
by: Jim Heavey | last post by:
Hello, I am trying to figure out how to get to the "footer" control in a datagrid. I set up the following logic: Dim cntrl As Control Dim cnt As Integer = dgNewMovies.Controls.Count For Each...
2
by: Jordan | last post by:
I'm curious if the whole point of Repeaters/Data Lists/Grids is encapsulating additional functionality like add/update/edit/deletes, but really does not provide any benefits when it comes to simply...
5
by: Craig G | last post by:
how do i go about this thru serverside code (VB.NET)? any links to any articles anywhere? basically i just want something simple that will loop thru all txt & cbo server side controls, and then...
2
by: Asha | last post by:
hello, i got many asp.net controls and i want to put the same values into all of the contorls. is there a better coding habit to allow me to loop through all these contorls with different id to...
7
by: Jim Bancroft | last post by:
Hi everyone, I'm struggling with something.....I'd like to loop over all of my page's HyperLink controls, and I'm not sure how to do it. Here's what I'm looking for, in pseudocode: foreach...
7
by: astro | last post by:
I am not farmilar with the object model for webforms. I want to loop through the web form controls - pulling out the checkboxes on the form like the following: For Each ctrl In Me.Controls ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.