Citeria like xyz does not work

P

postman

From a textbox on a form that is the "criteria" field for the query, I want
to be able to find records with names starting with the letter : Like"xyz*"
from a textbox on a form so the query will return a *bunch* of records that
match that user input. this maybe 2 letters or even 5 letters from the
title.
There is the sub-datasheet of the query on the form, which does not list
anything ATM.

This is what I have so far:
[forms]![Frm_FindTitle_ GAMES]![Input01] which is the input box on the form.

When I combine the Like"xyz*" with above statement it does not function.


Thanks in advance.
 
J

John Vinson

From a textbox on a form that is the "criteria" field for the query, I want
to be able to find records with names starting with the letter : Like"xyz*"
from a textbox on a form so the query will return a *bunch* of records that
match that user input. this maybe 2 letters or even 5 letters from the
title.
There is the sub-datasheet of the query on the form, which does not list
anything ATM.

This is what I have so far:
[forms]![Frm_FindTitle_ GAMES]![Input01] which is the input box on the form.

When I combine the Like"xyz*" with above statement it does not function.

Use a criterion of

LIKE [forms]![Frm_FindTitle_GAMES]![Input01]

if you want the user to enter the wildcards, or (probably better)

LIKE [forms]![Frm_FindTitle_GAMES]![Input01] & "*"

to supply the wildcard automatically.

You can only pass a value in a criterion - you cannot pass an operator
such as LIKE, that must be in the query itself.

John W. Vinson[MVP]
 
D

DubboPete

Try this in the criteria:

Like ([forms]![Frm_FindTitle_ GAMES]![Input01]) & "*"

that way they can type x, xy or xyz and come up records matching x... ,
xy... , or xyz.....

& "*" following the field name indicates that all records will be returned
if the field is left blank.

hth

DubboPete
 
P

postman

Brilliant thanks DubboPete.
The form works well, opening in the form view, but when I made another form
with a different query but same structure and based from a form; the form
now pops up one of those modals for the query criteria before going into
form view.
So my question is how do I turn of the modal popup and open in normal form
view so as to enter data xyz* in the text box not the modal popup box?

ps. Are you an Aussie from Dubbo NSW?
Thanks in advance.



DubboPete said:
Try this in the criteria:

Like ([forms]![Frm_FindTitle_ GAMES]![Input01]) & "*"

that way they can type x, xy or xyz and come up records matching x... ,
xy... , or xyz.....

& "*" following the field name indicates that all records will be returned
if the field is left blank.

hth

DubboPete

postman said:
From a textbox on a form that is the "criteria" field for the query, I
want to be able to find records with names starting with the letter :
Like"xyz*" from a textbox on a form so the query will return a *bunch* of
records that match that user input. this maybe 2 letters or even 5
letters from the title.
There is the sub-datasheet of the query on the form, which does not list
anything ATM.

This is what I have so far:
[forms]![Frm_FindTitle_ GAMES]![Input01] which is the input box on the
form.

When I combine the Like"xyz*" with above statement it does not function.
 
Top