Queries / Reports

  • Thread starter Thread starter Willy Smyt
  • Start date Start date
W

Willy Smyt

I have created a report driven by a query. When the report
is run, it asks for input from the user, the answer to the
input should be a 4 digit number... this number is
searched on a particular field on the database... any
records containing this number should show on the
report... but dont.

Lets say I am looking for all employees with a 5000 number
on a field we will call Assgn. The Assgn field is a text
field that contains more than one four digit number ie..
4500/5000/6000 for example. When I run the querry lets say
for 5000, only those records for which 5000 is first on
the field show up (5000/4500/6000 for example). If I use
*5000* instead, all records with 5000 show regardless of
the location on the field. The bad thing about it is, it
does not work either way when I run the report. Any
suggestions?

Thanks
 
Willy

First, you may want to consider further normalizing your data. Putting more
than one fact in a field (5000/4500/6000) creates all kinds of headaches
when it comes to writing queries and reports.

It seems like you are trying to use the "*" wildcard character to allow for
the string "5000" to appear anywhere in the text field. Here's how I'd
write that expression in a parameterized query criterion cell:

Like * & [Enter a number] & *

Access will modify this syntax slightly, but you get the idea. Is this how
your query reads?

Good luck

Jeff Boyce
<Access MVP>
 
Just adding to this, if you want it to pick on the first value, use

Like [Enter a number] & *
 
Willy

So, the query runs without incident. And you have double-checked that the
query used by the report is the same query that runs without incident...

Have you tried building a new version of the report, based on the query, to
see if it's a problem with the report?

Good luck

Jeff Boyce
<Access MVP>
 
Back
Top