robertjv
12-20-2007, 02:17 PM
I have a table with about 80 yes or no questions. I want to make the report such that only the fields whose value is "No" is displayed on the report.
I know what I want to do logically. I would like the report to loop through a specified set of fields and set their visibility properties to True when the value is No and False when the value is Yes.
I'm stumped.
liddlem
12-20-2007, 07:31 PM
If your form is based on a query (which it should be) then filter out the data in the query.
I.E. In the "Condition" criteria of the query, set its value to "False"
robertjv
12-20-2007, 08:53 PM
Its not a form. Its a report, based on the original table. The query would select out whole records. I want to select out individual fields in a single record.
Each report would consist of selected fields of one record.
:D
liddlem
12-21-2007, 02:52 AM
Ooooh - my apologies - replace3 the word "form" with "Report" however this still does not answer your question, do it?
. . . . so let me try again.
In this forum, I have seen ways of running a script at the time that a report is generated, but have not tried it myself. You may want to consider those posts before trying my "solution" that follows.
Are you saying that each record has 80+ fields and you want to select only the fields that are marked as false?
If this is the case, then you're in for a real tough time. I recently made the same mistake - I wanted to count all the True's and chart the data.
I've ALMOST got it sorted now. (Still working on the finishing touches)
The way that I solved the problem was to change the entire table structure. (You'll need to do a bit of reading about normalising databases)
In my case, we are trying to keep tabs on the different types of incidents that occur at different locations. Within my Incident table, I had 4 main categories which each consisted of a group (between 4 and 12) of T/F fields.
What I had to do was break these main categories into 4 sepearate tables. I then linked each of these tables to the Incident table with the Primary key (IncidentID) of the incident report.
So to break this down further, I started with the following T/F fields in the Incident table. (There were many other fields too)
MedIncWrongDrug - Was the wrong type of drug administered.
MedIncWrongDose - Was the wrong dose given
MedIncAllergy - Was the patient allergic
MedIncDiscrep - Was there a discrepancy in the medicine cabinet
MedIncWrongTime - Was medication administered at the wrong time
BioHazType - Was it a type of BioHazard
BioHazCause - Did this incident cause a Bio Hazard
BioHazManage - Must it be managed
So clearly, there are 2 groups here. (Med Incident and BioHazard)
The TblMedInc has 2 fields. (IncidentID, MedInc)
The TblBioHazInc has 2 fields (IncidentID, BioHaz)
And to ensure data integrity, I created 2 other tables which populate the MedInc and BioHaz fields in a ComboBox respectively.
I am then able to break down each category for the relevant stats using crosstab queries and charts accordingly.
One difference that I see between your need and mine is that I only want to count the "True" records. So I ONLY store a record IF it NEEDS to be stored. (Any "False" is not required by me.)
So my questions here would be. . .
Do you really NEED both the T/F info?
If so, then WHY? (I only ask so that other I and readers might get some insight into your needs.)
robertjv
12-21-2007, 04:44 PM
I want to do basically what you are doing. I do however want to keep track of both true and false data. I can certainly do a work-around by exporting to excel and transposing the data, but I was hoping there was an "in-house" solution.
The table is results from a workplace audit. The auditor will walk around the laboratory, circling yes or no for 80 questions. Basically the response to be sent back to the supervisor of that laboratory just needs to know the "no"s however I think it is good practice to have the data for the "yes"s available to track the worker habits over time.
The set of 80 questions can certainly be broken into a number of seperate tables.
I will read up on normalizing data, however I have a mental block with the crosstab queries as I am not really tabulating anything.
robertjv
12-21-2007, 04:58 PM
OK the articles that I've scanned through on the web dealing with normalizing data, are for columns that contain repetitive data. It doesn't look like this is appropriate for my needs. I'll never be filtering or summarizing sets of records for this table. One record is its own story and will never be combined with any other story :)
As you already been advised, base the report on a query, use the criteria section of the various fields to filter out the records you want or use the Where clause of the OpenReport method. The former option is much easier
robertjv
12-23-2007, 06:00 PM
thanks for the reply, but unless i can get a query to filter out specific fields (based on their values) of each individual record, it isn't a solution.