473,396 Members | 1,784 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,396 software developers and data experts.

Enabling / Disabling Controls by Checkbox

I am creating a form in Access, in the form there is a checkbox and some fields. I want to set the checkbox so, that if the user clicks on it, the fields should be enabled, if the checkbox has not been clicked, thann the fields remain disabled.

Could you please help me to write the VBA-code for this procedure?

Thank you!!

Alla
Jan 28 '08 #1
1 2536
nico5038
3,080 Expert 2GB
Best to use the .tag property of the formcontrols.
atJust mark the fields the should be enabled with a "E" in the .tag property (under the Other tab of the property popupform).

Now you can use this code in the OnOpen event of the form and the AfterUpdate of the checkbox:
Expand|Select|Wrap|Line Numbers
  1.  
  2. dim ctl as control
  3.  
  4. for each ctl in me.controls
  5.     if ctl.tag = "E" then
  6.       if me.checkboxfield then
  7.          ctl.enabled = true
  8.      else
  9.          ctl.enabled = false
  10.      endif
  11.    endif
  12. next
  13.  
Getting the idea ?

Nic;o)
Jan 28 '08 #2

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

Similar topics

0
by: Ashish Shridharan | last post by:
Hi All, Has anyone ever tried disabling a checkbox or a radiobutton web server control in netscape ? While a textbox and a button control renders disabled, .NET adds the disabled attribute to...
6
by: ML.Steve | last post by:
Hi, There are lots of posts on this subject but after a couple of hours of going though them I still can't get a number of fields to be disabled when a checkbox is ticked. Basically I have a...
2
by: HumptyDumpty | last post by:
Does anyone know if there is a problem with re-enabling the Screen Saver after it has been disabled programmatically. I am using the SystemParametersInfo function within User32.dll, and have...
3
by: Assimalyst | last post by:
Hi I am attempting to enable/disable webform controls depending on whether a checkbox is checked or not. I have an event handler for when the checkbox checked is changed ...
3
by: Tumurbaatar S. | last post by:
I'm trying to dynamically hide/show a HTML table server control. My form contains one CheckBox control and its AutoPostBack set to true. The Checked value of this box controls whether to show or...
7
by: John Meyer | last post by:
I have a program where I have to enable or disable a list box based upon a radio button. Is there an "enabled" property on select boxes?
2
by: mitzie | last post by:
Is it possible to enable and disable check box of active record using a continuous form? The problem with what I have done is if user entered multiple records, then clicked 1st option box, all...
8
by: ameen.abdullah | last post by:
Hi Guys, I have a checked list box on my form.. the purpose of this checkbox is to indicate that the option is enabled or disabled.. I just want to ask if there is a way to disable these check...
5
by: Chris Saunders | last post by:
I'm hoping that this question is not off topic on this newsgroup. If it is please redirect me if you know an appropriate group. I'm actually writing a program in another language (Eiffel) but if...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.