A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Parameter query where blank is like "*"



 
 
Thread Tools Display Modes
  #1  
Old October 27th, 2008, 03:34 PM posted to microsoft.public.access.queries
Dirtbike
external usenet poster
 
Posts: 19
Default Parameter query where blank is like "*"

I have a form and a paramter query. I want to be able to know that if the
form field is blank just give me all your records.
I tried IIF(Forms!Form1.Vend is NULL, "Like "&'"*", Forms!Form1.Vend) but
get no records when the field is blank.
Thanks for the help!!
  #2  
Old October 27th, 2008, 04:13 PM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Parameter query where blank is like "*"

Dirtbike wrote:

I have a form and a paramter query. I want to be able to know that if the
form field is blank just give me all your records.
I tried IIF(Forms!Form1.Vend is NULL, "Like "&'"*", Forms!Form1.Vend) but
get no records when the field is blank.



Try using the criteria:

=Forms!Form1.Vend OR Forms!Form1.Vend Is Null

--
Marsh
MVP [MS Access]
  #3  
Old October 27th, 2008, 05:51 PM posted to microsoft.public.access.queries
Dirtbike
external usenet poster
 
Posts: 19
Default I feel pretty dumb now.

You nailed it, I dunno how I messed it.

"Marshall Barton" wrote:

Dirtbike wrote:

I have a form and a paramter query. I want to be able to know that if the
form field is blank just give me all your records.
I tried IIF(Forms!Form1.Vend is NULL, "Like "&'"*", Forms!Form1.Vend) but
get no records when the field is blank.



Try using the criteria:

=Forms!Form1.Vend OR Forms!Form1.Vend Is Null

--
Marsh
MVP [MS Access]

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:37 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.