View Full Version : CheckBox report


Nica57
09-08-2007, 08:03 AM
Hi,
Could anybody help me with following problem.
I have several check boxes in my report and I want only valid ones to appear, the ones that have been checked in form. I cant use query and criteria, so how can I specify criteria in report.
Exampl:
Paid1 yes
Paid2 no
Paid3 yes
Paid4 yes
------------
I want in my report that only Paid 1,3 and 4 appear.

Tks Nica

Moniker
09-08-2007, 12:05 PM
The form needs to be open for this one to work. In the form's Format event, you put something like this (not exact -- going from my head here):

Paid1.Visible = Switch(Forms("YourFormName")!Paid1,True,True,False)
Paid2.Visible = Switch(Forms("YourFormName")!Paid2,True,True,False)
Paid3.Visible = Switch(Forms("YourFormName")!Paid3,True,True,False)
Paid4.Visible = Switch(Forms("YourFormName")!Paid4,True,True,False)

If you are not comfortable with swtich statements, each of the above would look like this as an if/then statement:

If Forms("YourFormName")!Paid1 = True Then
Paid1.Visible = True
Else
Paid1.Visible = False
End If

I used switch statements because four lines of code is easier than 20.

If you want to use the report without the form being open, you'll have to make a recordset object or use DLookups that point to the table that has the values for the checkboxes. You then read the values off of that table and do the same logic:

Paid1.Visible = DLookup("Paid1CheckboxName","YourTableTame")

etc.

Nica57
09-09-2007, 06:36 AM
Hi Moniker,
Tks for your replay, I tried all day to make something off it without success.
I didn't make exact description of my problem.
In the Form Customers i have fields like:
----------
Name
Address
Tel
Email
Amount
Paid (Checkbox)
----------
When you fill all details you check if customer have paid amount.
Some they have some not.
In Report (tabular design) I have details for each customer, some of them are checked as paid amount.
Without using query I have to filter and show all customers that have paid amount. So my question is how to put criteria for checkbox that will show me only checked (paid amount) customers.
Tks Nica