Question: Do you have one signature field or multiple signature fields in
your table?
If you have fields like Signature1, Signature2, Signature3
and the fields are Null or have a value other than a zero-length string
then you could try an expression in your query.
Field: JoinThem: (Signature1 + " or ") & (Signature2 + " or ") & (Signature3 +
" or ")
Or you could write a little VBA function to do this for you and use it in your
query.
Field: fConcatFields(" OR ",Signature1, Signature2, Signature3, Signature4)
The following VBA function is not fully tested.
Public Function fConcatFields(strConcat As String, ParamArray strArray())
Dim i As Integer
Dim vReturn As Variant
vReturn = Null
For i = LBound(strArray) To UBound(strArray)
vReturn = vReturn & (strConcat + strArray(i))
Next i
If Len(vReturn & "") > 0 Then
vReturn = Mid(vReturn, Len(strConcat) + 1)
End If
fConcatFields = vReturn
End Function
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
Jeff said:
Might be me that's missin'!
If you open your query in design view and add a selection criterion to the
field you wish to check (something like:
Is Not Null And <> ""
this would eliminate records with Null or zero-length string in the field in
question.
Regards
Jeff Boyce
Microsoft Office/Access MVP
I'm apparently missing something or not explaining my question properly.
I
understand the query sorts data to be displayed in the report but if the
fields are not listed in the actual report they will not show up. This is
where my example I had below and question are derived from.
What I'd like to do is have a report that does not show the actual fields
for every single signature type because each field has various field
sizes.
I'm wondering if you can create a report based off the query but instead
of
adding all the signature fields from the query (along with each label for
what type of signature it is) to the report, just put one text field in
the
detail section of the report and have some type of code to only display
the
fields for each record that has signature data in them (like the example
I've
shown below).
--
Todd
:
Todd
A general approach to reports is to base them on queries. That helps
limit
the records that will be "printed".
Regards
Jeff Boyce
Microsoft Office/Access MVP
That will work for the query but I was really trying to gear this
towards
the
report. Is there a way in the report to only show the signature fields
with
data in them for each record. For example,
Say the report header would look like this:
Manufacturer ID Signature (a generic label
to
cover all sigs)
And the detail section would be like this:
Company 1 12354 SHA1 - ab233ldleowowo
Company 1 54321 CRC - 25w8d34s or Dataman -
87d5e6d2
From above, some of the records do have more than one signature and I'd
like
to include every signature that is entered for each record but leave
out
the
signatures that don't have anything entered in them.
I'm just wondering if there is a way in the report to only have the
above
field headers and in the detail section of the report just have a
generic
signature text field with some type of control to only display the
signature
data and signature type that shows something like above but only based
off
of
one field.
--
Todd
:
Todd
In your query design, add something like the following to the
selection
criterion for your [signature] field:
Is Not Null And <>""
This will leave out records with either Null or zero-length string in
the
field.
Regards
Jeff Boyce
Microsoft Office/Access MVP
How do I create a report (through a query) to only show fields that
have
something in them? I"ve got a table and through a form I enter chip
signatures into multiple fields There are at least 8 to 10 different
chip
signature fields that could be entered and some of the records could
have
multiple signatures. ex: a record could have a SHA1 and a CRC
signature
but
not a dataman signature so the dataman signature field would be
empty.
How can I create the report to only show records with signatures
entered
and
leave off the report fields that don't have any data in the
signature
fields?