473,509 Members | 6,048 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!chkBoxLawnCare but that does not work. What am I
missing?

Tips/advice are welcome.
Many thanks.

Sep 11 '06 #1
1 2069
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=true) 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
3954
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...
10
11439
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....
6
2466
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,...
4
1631
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...
1
4131
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...
4
3300
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...
19
5188
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...
4
6485
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...
5
3468
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...
0
7137
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
7347
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7073
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
5656
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,...
1
5062
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...
0
4732
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
443
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...

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.