View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default Like Command Question

Is the question how to get the user's input in a way you can use for your
"like" search? That depends on whether you think you can teach your users
the wildcards or if you think they need some more intuitive way to input the
search criteria. If they know or can be taught the wildcards, all you need
is an input box to have them specify the string to use:
SearchStr = Inputbox("Enter the criteria for the search:")
' Enter your table lookup here (not sure how you are implementing it, could
be various ways) with the condition "[SearchFieldName] like '" & SearchStr&
"'"
' Note the single quotes around the 'like' condition

If users need more guidance you could set up a user form similar to an
"advanced search" form used for internet searches, with text boxes (for
example) that let them enter things like "Search for entries beginning with:"
and "Search for entries that contain the word:" and then set up your 'like'
wildcard match based on the input.

Not sure if this is what you are looking for, but hope it helps.

"dodge1984" wrote:

I was trying to get into the Access section, I am trying to use the Like
command inconjunction with imput from a user. In other words, what I want to
serch for is stored in a table. I know how to search based on that, but how
do I get to use the wildcard options of the like command