Null values in Parameter queries (or Wildcards)??? 
Author Message
 Null values in Parameter queries (or Wildcards)???

Hi,

I am trying to set up a query form where I provide a number of listboxes for
the user to select items from and pass the results directly to a parameter
query existing in my jet db. I am hoping to use this as a master report data
selector to be fired up before each report is printed. One thing I am
failing to manage is the case where the user does not want to limit records
ie choose *all* as the criteria. Anyone know of a magic character that the
parameter query will interpret as wildcard?

Alternatively I could create a select statement by VB code and thereby omit
the *all* in my "where x = y" sections but this will complicate the VB side
and I would love to make use of the query design flexibility on the Access
side. Oh, by the way I am using Access 97 & Jet 3.5

Any alternative ideas would be most welcome too. Are there any sample
projects somewhere that does something like this? A direct mail response
will be most appreciated. Regards,

TIA,
Kerem



Mon, 13 Nov 2000 03:00:00 GMT  
 Null values in Parameter queries (or Wildcards)???

Try this,

Example QueryDef SQL definition:

PARAMETERS P_SiteId Text;
SELECT SiteList.* FROM SiteList
WHERE SiteList.SiteId Like [P_SiteId];

When you enter a * it treats it as wildcard. You can also use complex
wildcards eg 1?1*.
This works even if the Field type is numeric.

Quote:

>Hi,

>I am trying to set up a query form where I provide a number of listboxes
for
>the user to select items from and pass the results directly to a parameter
>query existing in my jet db. I am hoping to use this as a master report
data
>selector to be fired up before each report is printed. One thing I am
>failing to manage is the case where the user does not want to limit records
>ie choose *all* as the criteria. Anyone know of a magic character that the
>parameter query will interpret as wildcard?

>Alternatively I could create a select statement by VB code and thereby omit
>the *all* in my "where x = y" sections but this will complicate the VB side
>and I would love to make use of the query design flexibility on the Access
>side. Oh, by the way I am using Access 97 & Jet 3.5

>Any alternative ideas would be most welcome too. Are there any sample
>projects somewhere that does something like this? A direct mail response
>will be most appreciated. Regards,

>TIA,
>Kerem



Mon, 13 Nov 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Null values in Parameter queries (or Wildcards)???

2. How to pass single, multiple or null parameter value(s) to multiple queries

3. Parameter Query/Null Value help

4. CAN ADODB.PARAMETER VALUE BE NULL?

5. Passing NULL value to report parameter

6. Parameters do not accept Null Values

7. report run with null parameter values via store procedure

8. Set ADO Parameter value to Null?

9. Null value into ADODB.Parameter

10. Help: VB and Null parameter query problem

11. Passing a NULL value to API parameters that take UDTs

12. Paramter Query/Null Value help

 

 
Powered by phpBB® Forum Software