Wildcard querying data using a Textbox object

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

Guest

Hi,

I'm trying to design a sort of search panel where the user types in the
first few letters of a customer's name into a textbox, clicks a command
button, and gets a list on the bottom of the form of all the customers where
the textbox's data has been found.

With my limited knowledge of Access querying and so forth i've managed to
get it to return when the full name is entered using:
Like [Forms]![Form1]![Text12]
or
[Forms]![Form1]![Text12]

but when i use:

Like ([Forms]![Form1]![Text12]+"*")

or anything like that as a critera that includes a "*" as the internal help
suggests is the wildcard nothing gets returned.

I've searched around the internet and all over the help sites, and now am at
a loss as to what to do.

Any help would be greatly appreciated.

-Beau
 
Thanks for the reply,

Did the trick.

Also tried the + again, and after toying with a few things seemingly
unrelated to the query it started to work...

Odd...

Thanks though.

Van T. Dinh said:
Like [Forms]![Form1]![Text12] & "*"

--
HTH
Van T. Dinh
MVP (Access)


Beau W. said:
Hi,

I'm trying to design a sort of search panel where the user types in the
first few letters of a customer's name into a textbox, clicks a command
button, and gets a list on the bottom of the form of all the customers where
the textbox's data has been found.

With my limited knowledge of Access querying and so forth i've managed to
get it to return when the full name is entered using:
Like [Forms]![Form1]![Text12]
or
[Forms]![Form1]![Text12]

but when i use:

Like ([Forms]![Form1]![Text12]+"*")

or anything like that as a critera that includes a "*" as the internal help
suggests is the wildcard nothing gets returned.

I've searched around the internet and all over the help sites, and now am at
a loss as to what to do.

Any help would be greatly appreciated.

-Beau
 
There are subtle differences between the concatenate operators "&" and "+".

1. "+" propagates Null, "&" doesn't, meaning:

"Test" & Null results in "Test"
"Test" + Null results in Null

1. "&" is a definite String operator so "&" will type-cast inputs if
required. "+" can also be an arithmetic operator so it may not type-cast
inputs. For example:

"Test" & 123 results in "Test123"
"Test" + 123 results in an error (Type Mismatch)
 
Hi Beau,

How did you create the text box that relates to the query??? im trying to
create a keyword search for an FAQ database, and i'd like to also have it
display at the bottom of the screen... i have a column that has the keywords
associated with every question i enter, but i want the user to type in a key
word, and get all the questions to display on the bottom of the form, or in a
printable report.....

any ideas? i know what i want, but i have no clue how to do this.

thanks,

Em~
 

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