Simple Query

  • Thread starter Thread starter Martin Tudge
  • Start date Start date
M

Martin Tudge

The query that I am running at the moment lets the user
search for a eight figure aphanumeric code.
When the users inputs the code to search via the input
form, they then press a button which opens up a macro.

The macro code is:
DCount("*","Query1")>0 Open Output Form
DCount("*","Query1")=0 Open Message Box saying 'No
records found'

When the Output Form opens to show the results it runs of
the query1 which is:

Criteria:[Forms]![number_search]![Text0]

This makes the search work exactly if the correct number
is put in and if not produces a message saying no records
found.
What I want to do now is give the user the option of using
the wild card '*'.
Therefore if they use 'NR*' the output form will then show
all the results which start with'NR'
Hope someone can help!
 
Change the criteria to

Criteria: LIKE [Forms]![number_search]![Text0]

OR If you always want the wildcard available

Criteria: LIKE [Forms]![number_search]![Text0] & "*"
 
Back
Top