Problem with 'Like' criteria

  • Thread starter Thread starter Xeon007
  • Start date Start date
X

Xeon007

Guest
I want to use the Like criteria on a query, so that it selects records based on the first character of their code. However, the first character is a hash (#) and it doesn't seem to work.

This is what I've entered as the criteria:

Like "#*"

Anyone help?
 
When using wildcard characters to search for an asterisk (*), question mark (?), number sign (#), opening bracket ([), or hyphen (-), you must enclose the item you're searching for in brackets. For example, to search for a question mark, type [?] in the Find dialog box. If you're searching for a hyphen and other characters simultaneously, place the hyphen before or after all the other characters inside the brackets. (However, if you have an exclamation point (!) after the opening bracket, place the hyphen after the exclamation point.) If you're searching for an exclamation point (!) or closing bracket (]), you don't need to enclose it in brackets.

For example: Like "[#]*"

The above can be found in the help files under "About using Wildcards"

HTH
 
I have a similar question.

I want my query to lookup criteria for a field from a textbox control on a form. I currently have it set like this:

Criteria: [Forms]![frmSearchForm]![txtTextBox]

How can I do this same thing, but add a "Like" to the beginning. I bet this is very simple and just a syntax thing I need to know.

Thanks.
 
Like [Forms]![frmSearchForm]![txtTextBox] & "*"

If you type 'B' it will find Bill, bug, boy.

Like "*" & [Forms]![frmSearchForm]![txtTextBox]

If you type 'ill' it will find Bill, Will...

[This message has been edited by Jack Cowley (edited 12-07-2001).]
 

Users who are viewing this thread

Back
Top Bottom