Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

1 Y/N checkbox on form to 1 Y chkbx and 1 N chkbx on Report 1

Status
Not open for further replies.

hansdebadde

Technical User
Jan 20, 2005
214
CA
I have one check box on my Access 2003 form called tbl_F7A_EEsPersonalCoverage. I have to print out a report that has a Yes checkbox and a No checkbox on it. I obviously want the Yes checkbox to be checked if the checkbox on the form is Yes and the No checkbox to be checked on the report if the one checkbox on the form is not checked. I tried
=IIf([tbl_F7A_EEsPersonalCoverage]=-1,True,True) in the control source of the Yes checkbox on the form and
=IIf([tbl_F7A_EEsPersonalCoverage]=-1,True,False)in the contol source of the No checkbox on the form.
I tried substituting -1 and 0 for Y/N as well.
Obviously it did not work or I wouldn't be begging for help. Any suggestions?
 
Hi
Haven't got time to check this, but have you tried "yes" and "no" - it's what you use on the qbf grid after all

Jonathan
 
=IIf([tbl_F7A_EEsPersonalCoverage]=-1,True,False)
=IIf([tbl_F7A_EEsPersonalCoverage]=-1,False,True)
 
Thanks both of you.Jonathan, I don't understand where you suggest yes and no. If you mean in the formula, I tried that and it didn't work. Lupins46, I tried that and all I get is the shaded check box. What next?
 
This may be a silly question but is the report and form linked to the same table. I tried what lupins wrote and it worked on a made-up report. I did notice that the boxes were shaded if the report was not linked to the table.

Also, Is your field in the table "tbl_F7A_EEsPersonalCoverage"
this seems to be a table name not a field name.


Chris
 
Yes the form and report are linked to the same table. All the other fields on the report work. If I just make a checkbox with the control source being the table data it will of course work and I can use this for the Yes checkbox on my report but I can't get the No one to work as its opposite.
tbl_F7A_EEsPersonalCoverage does look like a table name, but it isn't. The table is tbl_F7A. the reason i named it as such is EEsPersonalCoverage is in three similar tables tbl_F7A, tbl_F7On, tblF7BC. it just made sense to me when I did it.
 
can you post the source data for both your checked and unchecked as well as the source data for the control you said did work for the yes.

Thanks.

Chris
 
The Y/N checkbox in the form's source data is tbl_F7A_EEsPersonalCoverage as well as the Y checkbox in the report. the tbl_F7A_EEsPersonalCoverage field in the table is Y/N
 
what was the results with what you first posted at the beginning?

Chris
 
I think I may of figured it out.

1. Delete the control if you copied it out of the field list on the report. (This is very very important)

2. add a checkbox from the toolbox not the field list.

3. add the control source as discussed above

Chris
 
Bingo, that was it. Once i did it with a new checkbox it worked!!! thanks a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top