How can I select correct fields?

H

hanski

hi.

I have a query, in which is a field called "City". In my Cities table
there are 25 fields. Cities table has 2 columns: number and name.
Numbers are from 1 to 25.

I have in my query a parameter: " Like * & [Give me the number of
city] & * "

When I only press enter when it is asking me [Give me the number of
city] I will get all the cities and that is correct. But.

When it is asking me [Give me the number of city] and I will give for
instance number 2, so it will give me cities 2,12,20,21,22,23,24,25.

How can I make it so that if I press only enter it will give me all
BUT if I give it some number it will give me ONLY that numer. Is it
possible?


many thanks

Hannu
 
D

Douglas J. Steele

Presumably you mean you currently have

Like "*" & [Give me the number of city] & "*"

Try:

Like "*" & [Give me the number of city] & "*" Or ([Give me the number of
city] IS NULL)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top