As I kinda stated earlier it is much easier to filter a report. I don't
generally show datasheet views of tables or queries to users. Build a
report, there cool.
For instance, assuming you have check boxes on your criteria form and the
Tag property of each check box contains the actual field name of the
yes/no
field in your report record source. You can use simple code that loops
through the form controls and finds check boxes that are checked. The
code
uses the Tag property to build a where clause to open the report. The
opened
report will have the records for the checked boxes on your criteria form:
Dim strWhere As String
Dim ctl As Control
strWhere = "" 'initialize the where clause
For Each ctl In Me.Controls 'loop through all controls on form
'find the check boxes
If ctl.ControlType = acCheckBox Then
'find the true check boxes
If ctl.Value = True Then
'add to the where clause
strWhere = strWhere & "[" & ctl.Tag & "] or "
End If
End If
Next
If Len(strWhere) > 1 Then
'remove the last " or " from the where clause
strWhere = Left(strWhere, Len(strWhere) - 4)
End If
'the final strWhere might look like
' [ArmRests] or [TV] or [Carpet] or [Seats] or [Head] or [Over head
Compartment]
'open the report based on the checked boxes
DoCmd.OpenReport "rptCheckList", acViewPreview, , strWhere
--
Duane Hookom
MS Access MVP
Aviator said:
Sorry, no disrespect meant, I thought I had answered. Users see the
results
in the query, no need for me to make it pretty in a report.
:
Ok, forget the un-normalized tables since they seem to be working for
you
and "There will be no more added".
Don't continue to forget my question:
"I expected to get an answer from you like "Yes, the results of the
query
are
displayed in a report". Do your users see the query or do they see the
results of the query in a form or report?"
Is it too difficult to answer a simple question? You aren't the only
person
in need of help that seems to ignore questions from those who try to
help.
Maybe we need to ask our questions in the first statement of our
replies.
--
Duane Hookom
MS Access MVP
I have the aircraft broken into 25 items(check boxes). What ever
section
is
worked on is what is selected. There will be no more added. A catch
all
"Other" is included. When a user needs to qoute work to be done on a
arm
rest, they would select the check box for seats in the parameter
query
form
that I am trying to get to work. If they need to qoute a job that
will
work
on arm rests and a TV installation for a lear jet, they would select
lear
jet
from the list box of aircraft and the seat check box, and
entertainment
check
box. This, (as I hope) would return the work orders that were from a
lear
jet
that had seat work and/or entertainment work. This would give the
user
a
starting point to determine what they should qoute it for.
:
You don't understand my comments on normalization. You should not
have
fields like "seats", "carpet",... These are data values and should
not
be
field names. How would you handle work done on a new item such as
"Arm
Rests"? You shouldn't have to add fields and controls to maintain a
system.
I expected to get an answer from you like "Yes, the results of the
query
are
displayed in a report". Do your users see the query or do they see
the
results of the query in a form or report?
--
Duane Hookom
MS Access MVP
I tryied doing this database with a combo box instead of check
boxes
and
it
was ineffiecient. This way a user can simple check multiple
categories
of
work that were performed on a job instead of creating a different
record
for
each type of work performed. Example, on an aircraft, work done
on
the
seats,
carpet, windows. The boxes seats, carpet, windows would be
selected
so
when a
user goes to quote a new job they can look back at past work
completed
in
those categories and use the time and cost from those past jobs.
The
query/report will display the work order number so that user can
simple
look
in those work orders and find the info they need.
:
One of your issues is that your table is not normalized. 25
check
box
fields
is not the ideal way to store your data.
However, I expect you want to display your results in a form or
report.
If
so, this question is much easier to answer.
--
Duane Hookom
MS Access MVP
I am creating a database to manage past jobs done for quoting
possible
new
jobs. My database has fields for basic info about the
customer,
than
25
check
box fields with different categories of work completed. One
job(record)
will
have multiple boxes cecked depending on the work completed. I
want
to
run
a
parameter query through a form with those 25 check boxes. I
want
it
so
that
if I select one of those boxes, all records that have that
field
selected,
will be shown. If multiple boxes on the form are selected, any
record
that
has just one of those fields selected, they will be shown.
Help
would
be
greatly appreciated. I have the form created, but have been
unable
to
return
results. No errors messages.