473,669 Members | 2,304 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

List of Checkboxes on a form

RLN
Hello.

Re: Access 2003

I have a survey application that has 10 independent checkboxes on a
form (chkLawnCare, chkCarpetCare, chk DrivewayMaint, etc.)
One, or any combination can be checked before the form is submitted for
processing.
I need to do certain processes if checkboxA is checked, then other
processes if ChkBoxB is clicked, and yet a third set of processes if
ChkBoxC is clicked, etc.

How can I loop through the checkboxes on a form (regardless of
quantity; in case more are added later) and retrieve their names, then
do certain processes based on which ones are checked?

I'm trying to write this application with the vba code residing in vba
modules, rather than inside of the form object.
This is because I heard if you have VBA code behind your form and your
form gets corrupted, you lose the code too. Is this true?
If it is, I want to run this code in an independent vba module outside
of 'frmMain', but still reference the controls in this form.

I tried frmMain!chkBoxL awnCare but that does not work. What am I
missing?

Tips/advice are welcome.
Many thanks.

Sep 11 '06 #1
1 2074
dim ctl as control
for each ctl in Me.Controls
if typeof ctl is checkbox then
'do something
end if
next ctl

I would use a subform (maybe with a bound combobox with
LimitToList=tru e) instead of checkboxes. Unless you're going to
perform some action if a checkbox is not checked.

You should also probably read Keri Hardwick's comments on surveys.
It's in this NG from like 6 years ago.

But then if you need to check each one, you could just do something
like
if me.chk1=True Then
'do something
end if

Sep 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3958
by: Pete | last post by:
There is a Summary/Example further down... On page one of my site I have a form with some checkboxes and detailed descriptions. When the form is submitted (to page two), the values of the checkboxes are picked up using $_POST and put into session variables. On page two there is another form which is simply a condensed version of the previous one (titles with no descriptions). The checkboxes are named the same on both forms. When...
10
11454
by: Steve | last post by:
I'm not sure if I should be using tables here to structure the layout or if CSS is okay. I have a data entry form in which I have floated the labels to one side, and given them a specific width. With regular input such as textboxes, everything lines up fine. The problem I'm having is that I have an unordered list of checkboxes, and only the first item will line up with the label. The additional checkboxes and their labels end up being...
6
2469
by: Timo | last post by:
I have this list of checkboxes displaying properly in Opera and IE, but cannot get it in Firefox. For some reason, in FF, the checkboxes creep farther and farther to the right across the page, with each successive line: This is item one This is item two This is item three This is item four I would be grateful for some pointers on what's causing it and what I can do
4
1637
by: JamesB | last post by:
I have a form on a page that is built on results from a db query. The user can tick boxes/edit fields etc, and then submit to a second page that will update the db. How do I know what my POST fields are and how many in the second page (I am naming my fields in the form on the first by being a common name with a unique ID from each record on the front, ie. each record has a id_name, id_email etc etc. Yes, I'm a bit of a newbie to this......
1
4141
by: babu17 | last post by:
hi, i have a list of checkboxes, the number of checkboxes is dynamic. All the checkboxes have same name. i am trying to get the length of selected checkboxes. <input type=checkbox name=name1 value=1> <input type=checkbox name=name1 value=2> ........ get dynamically. when i try to get the length in javascript like
4
3309
by: jeet | last post by:
Plz help me.Problem is that On the first page I display all other user with checkbox and give user option to select only two user which he wants to send message. Tell me please how I'll get those checkboxes value and name on the next page and send message to only those two selected user. Thanx in advance
19
5203
by: Brian Kendig | last post by:
I want to have a set of nested UL elements where every LI has a checkbox associated with it, and the checkboxes are all lined up vertically either to the left or the right of the list. In other words, something like this (my apologies if you're not using a fixed- width font): x - Item 1 x - Item 1a x - Item 1b x - Item 2
4
6492
by: TechnoAtif | last post by:
Hi ALL I have entered some array values using checkboxes into mysql database through a form. Next iam creating a searchpage where all those cateogories inserted through checkboxes has to be retrieved using list/menu box. When i check only a single checkbox to insert the checked category ,selecting that category through list box gives out the entire data of the user corresponding to that category. However when i check multiple checkboxes and...
5
3489
by: Esmeralda | last post by:
My situation: I have a dynamic form with checkboxes. The checkboxes are submitted and added to a database. They are a list. I want to compare the list with what is currently listed in the database. If there is anything new or removed, I want to know with a variable that says changed. Basically: Checkboxes = 1,2,3 Database rows and fields are: row | field 1 | 2
0
8462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8382
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8586
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7405
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2028
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.