Passing wildcard characters to a query

  • Thread starter Thread starter Olden
  • Start date Start date
O

Olden

Hello I have a form that users configure a query from.
(In that query the criteria is [Control Name])

It works in that if I take a known data sample, enter it verbatim into my
form the right records get returned.

Here's the how do I:

Dates: would like to pass wildcard characters (1/*/2006) to the query.

Empty fields: pass emptiness to the query (as in no criteria).

Can anyone help?


Thanks in advance,

Olden
 
Hello I have a form that users configure a query from.
(In that query the criteria is [Control Name])

It works in that if I take a known data sample, enter it verbatim into my
form the right records get returned.

Here's the how do I:

Dates: would like to pass wildcard characters (1/*/2006) to the query.

Dates ARE NOT TEXT STRINGS. Wildcards will not work properly. You may
need to use calculated fields Year([datefield]), Month([datefield])
and Day([datefield]) and apply criteria such as

[Enter year:] OR [Enter year:] IS NULL

with corresponding criteria for month and day.
Empty fields: pass emptiness to the query (as in no criteria).

Use a criterion of

[Control Name] OR ([Control Name] IS NULL AND [fieldname] IS NULL)

to match a user entry to a field value, or a NULL user entry to a NULL
field value.

John W. Vinson[MVP]
 
Sorry it took little over a month to reply, but it worked great, thanks.


Cheers,

Olden


John said:
Hello I have a form that users configure a query from.
(In that query the criteria is [Control Name])

It works in that if I take a known data sample, enter it verbatim into my
form the right records get returned.

Here's the how do I:

Dates: would like to pass wildcard characters (1/*/2006) to the query.


Dates ARE NOT TEXT STRINGS. Wildcards will not work properly. You may
need to use calculated fields Year([datefield]), Month([datefield])
and Day([datefield]) and apply criteria such as

[Enter year:] OR [Enter year:] IS NULL

with corresponding criteria for month and day.

Empty fields: pass emptiness to the query (as in no criteria).


Use a criterion of

[Control Name] OR ([Control Name] IS NULL AND [fieldname] IS NULL)

to match a user entry to a field value, or a NULL user entry to a NULL
field value.

John W. Vinson[MVP]
 
Back
Top