Display a query using a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that when a street name is entered it displays the result of a
query that search's a address field for a street name. In the address field I
have this string: Like ("*" & ([Forms]![StreetLookup]![text10]) & "*"). This
does work but when I display the form for the first time it displays a whole
list of addresses instead of being blank.
The forms default view is continuious. I have used this tecnique before for
other lookups and the initial form always came up blank.
 
Using the criteria you list, if Text10 is blank, then the criteria is

Like("**")

This will return all records. Instead try:

Like (IIf(IsNull([Forms]![StreetLookup]![Text10]), Null, "*" &
([Forms]![StreetLookup]![text10]) & "*"))

If you have Null values in this field, then those records will still be
returned. If so, replacing Null with "" may do what you need.
 

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

Back
Top