473,795 Members | 2,892 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checkbox on Forms

I created a form that lists all the players from a particular squad in my
database. I used the Wizard to create the form and populate the form with
the results from a sqad query. It works. My next phase is to add check
boxes to the form to allow the user to select the appropriate players that
will play in the next game and send the selected players to a form for
printing. I'm facing two issues. The first is that when I added the
checkbox to the form, each player returned in the form has a checkbox, which
is good. But when I select one checkbox it enables all of the checkboxes.
The second issue is how to I get the selected players to a report that will
list them in a column under Player Name? Any help would be greatly
appreciated.

Thanks

JW

--
<link removed>
Jun 6 '06 #1
19 8961
On Tue, 06 Jun 2006 14:50:04 GMT, jdub via AccessMonster.c om wrote:
I created a form that lists all the players from a particular squad in my
database. I used the Wizard to create the form and populate the form with
the results from a sqad query. It works. My next phase is to add check
boxes to the form to allow the user to select the appropriate players that
will play in the next game and send the selected players to a form for
printing. I'm facing two issues. The first is that when I added the
checkbox to the form, each player returned in the form has a checkbox, which
is good. But when I select one checkbox it enables all of the checkboxes.
The second issue is how to I get the selected players to a report that will
list them in a column under Player Name? Any help would be greatly
appreciated.

Thanks

JW


You first need to add a check box field to the underlying table.
Then add that check box field to your form.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jun 6 '06 #2
Ifyou checkbox is not bound to a data field, then setting one sets all
instances.

First, you have to have a true/false field you can bind to for each player.

Second, you probably don't want that in your main data table, which I assume
you're using to populate your form. If the setting is temporary (you're
going to set it, use it a bit, and then you don't care) you can probably get
away with it in the main table. Doubtful. I'd probably make a table to
hold a list of player primary keys and a true/false field. With one action
query you can copy all the player primary key values to the foreign key
field in the new table, and also set the yes/no field to yes, or no,
whichever you prefer for the default.

then, your display, would be driven by the new table, and you could bind
your checkbox to the yes/no field.

And...you'll probably want to create more than one list eventually, so you
might as well create some ListID value and put that in the new table also.
You can either create it on the fly as you append the rows, or you can get
formal and have a ListMaster and ListDetail table pair. When you create a
new list, you put one row in ListMaster, get its primary key, and use that
primary key as a foriegn key in the new rows in ListDetail.

How elaborate do you want to be?
Jun 6 '06 #3
Rick,

Thanks. I'm a newbie and think I follow your suggestions. I'm going to give
the a shot.

Jdub

Rick Wannall wrote:
Ifyou checkbox is not bound to a data field, then setting one sets all
instances.

First, you have to have a true/false field you can bind to for each player.

Second, you probably don't want that in your main data table, which I assume
you're using to populate your form. If the setting is temporary (you're
going to set it, use it a bit, and then you don't care) you can probably get
away with it in the main table. Doubtful. I'd probably make a table to
hold a list of player primary keys and a true/false field. With one action
query you can copy all the player primary key values to the foreign key
field in the new table, and also set the yes/no field to yes, or no,
whichever you prefer for the default.

then, your display, would be driven by the new table, and you could bind
your checkbox to the yes/no field.

And...you'll probably want to create more than one list eventually, so you
might as well create some ListID value and put that in the new table also.
You can either create it on the fly as you append the rows, or you can get
formal and have a ListMaster and ListDetail table pair. When you create a
new list, you put one row in ListMaster, get its primary key, and use that
primary key as a foriegn key in the new rows in ListDetail.

How elaborate do you want to be?


--
Message posted via http://www.accessmonster.com
Jun 6 '06 #4
Fredg,

Thanks for your reply. Once I added the check box field to the table, how do
I get the results to a report?

Can the selections be Control Sources of some sort for the Player Name field
on the report?

Thanks,

JDUB

fredg wrote:
I created a form that lists all the players from a particular squad in my
database. I used the Wizard to create the form and populate the form with

[quoted text clipped - 11 lines]

JW


You first need to add a check box field to the underlying table.
Then add that check box field to your form.


--
Message posted via http://www.accessmonster.com
Jun 6 '06 #5
Typically:

docmd.openrepor t "MyReport", , , "MyYesNoField=T rue"

You may have additional criteria, of course, such as

docmd.openrepor t "MyReport", , , "MyYesNoField=T rue And ListID = '" &
Me.cboMyListID & "'"
Jun 6 '06 #6
Rick,

I think I have thoroughly confused myself on this one. Steps I followed.

1. Created a field in the main database called Active Roster.
2. The Active Roster field has a datatype of Text
3. Added a Check box to the Roster Form
4. Without an empty Control Source Field, when the report runs, 1 click
selects all
5. When I enter the main database and field name in the control source field
and run the report, I'm unable to select any of them.

Help!!!!!

1. Should I make the data type for the roster field to be YES/NO?
2. What do I do with the checkbox?

Thanks,

JDUB

Rick Wannall wrote:
Ifyou checkbox is not bound to a data field, then setting one sets all
instances.

First, you have to have a true/false field you can bind to for each player.

Second, you probably don't want that in your main data table, which I assume
you're using to populate your form. If the setting is temporary (you're
going to set it, use it a bit, and then you don't care) you can probably get
away with it in the main table. Doubtful. I'd probably make a table to
hold a list of player primary keys and a true/false field. With one action
query you can copy all the player primary key values to the foreign key
field in the new table, and also set the yes/no field to yes, or no,
whichever you prefer for the default.

then, your display, would be driven by the new table, and you could bind
your checkbox to the yes/no field.

And...you'll probably want to create more than one list eventually, so you
might as well create some ListID value and put that in the new table also.
You can either create it on the fly as you append the rows, or you can get
formal and have a ListMaster and ListDetail table pair. When you create a
new list, you put one row in ListMaster, get its primary key, and use that
primary key as a foriegn key in the new rows in ListDetail.

How elaborate do you want to be?


--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200606/1
Jun 6 '06 #7
Are you truly entering the "main database and field name in the control
source field"? Controls in access bind to fields in tables and queries.

In the simple case, you'd have

tableName
NameID
ContactName
InRoster (this is the yes/no field)

On some subform in continuous form view, you'd put a checkbox in the detail
section, such as chkInRoster, bound to control source InRoster. The form
itself would be bound to the table tableName.

That's a bare-bones desription of a way to do what you're after, I think.

Then, once you check the boxes on theappropriate rows, you run your report:

docmd.openrepor t "MyRoster", ,,,"InRoster=Tr ue"
Jun 6 '06 #8
Thanks for your help.

I'm good all the way up to the actual report. Where does this code go?

I've created a report that should list the selected player names in sequence.

I created a text box under the player name heading. Do I configure the
control source for this field???

What are the steps to put the selected records into the field?

Thanks,

Jdub

w_a_n_n_a_l_l_ -@-_s_b_c_g_l_o_b_ a_l._n_e_t wrote:
Are you truly entering the "main database and field name in the control
source field"? Controls in access bind to fields in tables and queries.

In the simple case, you'd have

tableName
NameID
ContactName
InRoster (this is the yes/no field)

On some subform in continuous form view, you'd put a checkbox in the detail
section, such as chkInRoster, bound to control source InRoster. The form
itself would be bound to the table tableName.

That's a bare-bones desription of a way to do what you're after, I think.

Then, once you check the boxes on theappropriate rows, you run your report:

docmd.openrepo rt "MyRoster", ,,,"InRoster=Tr ue"


--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200606/1
Jun 7 '06 #9
If you're asking me about creating a report the best way is to select your
table in the database window and then click Insert | Report and choose
report wizard. Follow the prompts. Make a report. If you don't like how
it looks, delete it, do it again. The wizard is pretty simple. By the way,
tip: You don't have to display a field to filter by it. In other worods,
this statement:

docmd.openrepor t "MyRoster", , , "InRoster=T rue"

works whether InRoster appears on the report as a checkbox (or anything
else) or not. As long as the recordsource of the report is the table
itself, you have all the fields in that table available to you. You display
the players' names on the report by putting a control on the report and
using the player name field as the controlsource.
Jun 7 '06 #10

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

Similar topics

0
2133
by: claudel | last post by:
Hi I have a newb PHP/Javascript question regarding checkbox processing I'm not sure which area it falls into so I crossposted to comp.lang.php and comp.lang.javascript. I'm trying to construct a checkbox array in a survey form where one of the choices is "No Preference" which is checked by default. If the victim chooses other than "No Preference", I'd like to uncheck
1
5185
by: Jason Dykes | last post by:
I have a page that is database driven. The pages shows a user's name and whether they have access to our site or not. this is done by displaying two checkboxes positioned to the right of the users name. The first checkbox is to deny the user access and is named something like chkD followed by the user's id number from the database (ie; chkD20). The second checkbox is to allow the user access and is named chkA followed by the user's id...
2
2397
by: Menelty | last post by:
I have 2 datagrids on my page and each one has a template column which has a checkbox relating to each specific row. I usually have one on the page and use javascript to make sure there has been x number of selections before allowing the user to proceed. I use the code below for this: for (var n=0; n < document.forms.length; n++) { if (document.forms.elements.type=='checkbox') {
4
7303
by: Steph | last post by:
Hello, Can someone tell me the script to use for having a change on the same page when using checkbox function ? For example, i would to check one condition and display dynamically a button if the condition is checked on the same page. Thanks in advance for your help
1
9473
by: kiran | last post by:
I cratee a form to meet the fallowing requirement. 1. If any node is selected the corresponding checkbox should be checked 2. If any checkbox is clicked the corresponding node should be selected 1st requirement is working ,but, 2nd requirement is not wokring properly. when I click a checkbox the coresponding node is being selected , but checkbox is not in checked mode. To get the check box in checked mode i have to click two times or...
4
3260
by: Wolfgang Uhr | last post by:
Hello I've the following code Panel pnlData = new System.Windows.Forms.Panel(); CheckBox checkBox = new System.Windows.Forms.CheckBox(); checkBox.AutoSize = true; checkBox.Dock = System.Windows.Forms.DockStyle.Top; checkBox.Name = "checkBox"; checkBox.TabIndex = 1;
29
3155
by: Amer Neely | last post by:
I've got a dynamically built form with checkboxes for each element ( a list of file names in a directory). I need to grab only those checkboxes that are checked, so I can then delete those files. Does each checkbox name have to be unique? I was hoping to just group them under one name, and select from that array. PHP is not my native language - I'm coming at this from Perl, so bear with me, things are a little different in that country.
9
1798
by: morellik | last post by:
Dear all, I have a program that creates dinamically a web page. In the page I have the following function to check how many checkbox are checked. function tarInfo(info) { var i=0; var c=0; var l=document.forms.selected_files.length; alert(l);
1
2060
by: bird | last post by:
Greetings, I'm trying to calculate the total on an php page. I'm able to get the checkbox portion to work properly but I'm having trouble with the textbox "txtshipping". The default is 7.95 but if changes I need to change the total. How can I make the totalbox the default of the textbox of "txtshipping"?
3
3688
by: uremog | last post by:
I have a set of of check boxes. onClick, the checkboxes call check_radio and recup_checkbox. the referenced radios function as group selectors. check_radio just unchecks the radios if someone manually selects checkboxes. i think the problem is in the add_selection and del_selection as suggested by the alerts, which are for debugging only. it gets as far as the alert(add/del selection) alerts in FF. all the alert tests pass in IE. as...
0
9673
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
10443
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10216
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
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
9044
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
7543
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
6783
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
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

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.