473,804 Members | 3,462 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
19 8962
Thanks for your reply. Maybe I'm not clear in my explanation. I'll try
again.

I've created a form that pulls players names from the database(Player Name).
On the form by each name I've inserted a Checkbox and it's bound to the
RosterField. RosterField is a YES/NO datatype field. I also created a
command on the same form that will open up a report and supposedly input the
selected players.

The command button on the form is a Preview Report Button: The Event
Procedure code for On Click is below:

Private Sub Preview_Report_ Click()
On Error GoTo Err_Preview_Rep ort_Click

Dim stDocName As String

stDocName = "GameRoster "
DoCmd.OpenRepor t stDocName, acPreview

Exit_Preview_Re port_Click:
Exit Sub

Err_Preview_Rep ort_Click:
MsgBox Err.Description
Resume Exit_Preview_Re port_Click

End Sub

So far everything is good. The GameRoster opens up but is only displaying
the headers I created. I assume that there has to be a field or fields
designed in the Detail portion of the report that will store the selected
Player Names. Does that make sense? I've created reports and associated the
fields under my column headers with fields from the database. But in this
fashion, how and where in the report do I get the selected player names on
the report?

Thanks,

Jdub
w_a_n_n_a_l_l_ -@-_s_b_c_g_l_o_b_ a_l._n_e_t wrote:
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.openrepo rt "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.


--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200606/1
Jun 7 '06 #11
Your quote "You display
the players' names on the report by putting a control on the report and
using the player name field as the controlsource."
I reread this statement and understood it this time. Okay, you say "putting
a control on the report". Is a text box with a control source considered a
control? I created a text box under my player name header and tied it to the
Player Name field of the database. I ran my form and selected 5 players.
Click the Preview Report button and there is only 1 of the 5 players selected.
Looks like we're getting close. I'm missing something.

Thanks for your patience by the way. :-)

Jdub
w_a_n_n_a_l_l_ -@-_s_b_c_g_l_o_b_ a_l._n_e_t wrote: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.openrepo rt "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.


--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200606/1
Jun 7 '06 #12
this would be a lot easier if you would post the table designs (at least the
primary and foreign keys, a few fields of interest, and anything related to
the task).

When you say things like "On the form by each name I've inserted a Checkbox
and it's bound to the RosterField" I can't tell what you've done.

If you're using a continuous subform to display a list of names, you'd have
exactly one checkbox in the detail section next to the player name, if your
underlying table contains the name and the yes/no field.

Without good solid info like that, this is an exercise in futility.

Please - table designs, just for a start.
Jun 7 '06 #13
Okay,

Here is my Main Registration Table and the fields of importance.

Registration Table

PlayerID Autonumber - Primary Key
SSN Text
Player Name Text
..
..
..
..
Squad Text
RosterField Yes/No

More to come..

w_a_n_n_a_l_l_ -@-_s_b_c_g_l_o_b_ a_l._n_e_t wrote:
this would be a lot easier if you would post the table designs (at least the
primary and foreign keys, a few fields of interest, and anything related to
the task).

When you say things like "On the form by each name I've inserted a Checkbox
and it's bound to the RosterField" I can't tell what you've done.

If you're using a continuous subform to display a list of names, you'd have
exactly one checkbox in the detail section next to the player name, if your
underlying table contains the name and the yes/no field.

Without good solid info like that, this is an exercise in futility.

Please - table designs, just for a start.


--
Message posted via http://www.accessmonster.com
Jun 7 '06 #14
I created a form called DJF Registration Table222 - The form has a record
source of DJF Registration Table(This is my main registration table)

Form Header
Detail Header
Label - Player Name Text Box with Control Source Player Name
Checkbox with Control Source Rosterfield

Form Footer

Preview Report Button with the following code for the On Click Event
Procedure

Private Sub Preview_Report_ Click()
On Error GoTo Err_Preview_Rep ort_Click

Dim stDocName As String
Dim strWhere As String

stDocName = "GameRoster "
DoCmd.OpenRepor t stDocName, acViewPreview
Exit_Preview_Re port_Click:
Exit Sub

Err_Preview_Rep ort_Click:
MsgBox Err.Description
Resume Exit_Preview_Re port_Click
End Sub

I'm able to receive the players listed in the DJF Registration Table222 form.
I'm able to select the checkboxes appropriately based upon the player I would
like to listed on the report. The problem comes when I click the Preview
Report button for the GameRoster Report. The GameRoster Report opens and
there is only 1 entry(the first entry in the database), even though I
selected multiple players on the DJR Registration Table222form.

The Record Source for the report is the DJF Registration Table. I created a
text box with control source Player Name.
Does that help any?
jdub wrote:
Okay,

Here is my Main Registration Table and the fields of importance.

Registration Table

PlayerID Autonumber - Primary Key
SSN Text
Player Name Text
.
.
.
.
Squad Text
RosterField Yes/No

More to come..
this would be a lot easier if you would post the table designs (at least the
primary and foreign keys, a few fields of interest, and anything related to

[quoted text clipped - 10 lines]

Please - table designs, just for a start.


--
Message posted via http://www.accessmonster.com
Jun 7 '06 #15
Yes it helps, although I'm still not sure what "Deatil Header" means, but
later for that. This code:
stDocName = "GameRoster "
DoCmd.OpenRepor t stDocName, acViewPreview

should be printing every record in your registration table, unless you've
restricted the recordsource somehow, but you say that the recordsource of
the report is the table itself.

How many pages do you get in Print Preview?
Jun 7 '06 #16
Detail Header is listed when you're in design view of a form.

I only get 1 blank page.

w_a_n_n_a_l_l_ -@-_s_b_c_g_l_o_b_ a_l._n_e_t wrote:
Yes it helps, although I'm still not sure what "Deatil Header" means, but
later for that. This code:
stDocName = "GameRoster "
DoCmd.OpenRepor t stDocName, acViewPreview


should be printing every record in your registration table, unless you've
restricted the recordsource somehow, but you say that the recordsource of
the report is the table itself.

How many pages do you get in Print Preview?


--
Message posted via http://www.accessmonster.com
Jun 7 '06 #17
I double checked and yes the RecordSource is the registration table for the
report GameRoster. I have defined a text box field on the report which is
the Control Source for the field Player Name, which comes from the
registration table.

w_a_n_n_a_l_l_ -@-_s_b_c_g_l_o_b_ a_l._n_e_t wrote:
Yes it helps, although I'm still not sure what "Deatil Header" means, but
later for that. This code:
stDocName = "GameRoster "
DoCmd.OpenRepor t stDocName, acViewPreview


should be printing every record in your registration table, unless you've
restricted the recordsource somehow, but you say that the recordsource of
the report is the table itself.

How many pages do you get in Print Preview?


--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200606/1
Jun 7 '06 #18
There is no Detail Header. There are Form Header, Page Header, Detail, Page
Footer and Form Footer. Detail refers to the Detail section, as Form Header
refers to the Form Header section.
Jun 7 '06 #19
OK. Try this. WIth your report in design view, click on the RecordSource.
You should see s button with three dots appear. Click on that button, click
yes (you want to build a query on a table). That opens the query design
grid. You'll throw this one away, but I need to know what you get. From
the list of table fields, drag the "*" down to the grid. then run the
query. How many rows of data do you see?
Jun 7 '06 #20

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
5187
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
2398
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
7305
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
9475
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
2062
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
3690
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
9708
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
10589
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
10340
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...
0
10085
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7625
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
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
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
3828
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2999
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.