Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 13th, 2005, 09:58 AM
Jim
Guest
 
Posts: n/a
Default Query through form with or without data specified

Hi all... I'm really scratching my head over this one...

I have a form that pops up that has three criteria fields on it,
BeginDate, EndDate, and UserID. I want the person filling out the form
to enter a begin and end date for the report, and either leave the
UserID field blank (to specify the report is for all users) or to input
a 4 digit ID for the specific user they want to run the report for.
Pretty easy until I get to the User ID part... I don't know how to do
it.

The Date field has the criteria:
Between [Forms]![GetDatesIP]![BeginDate] And
[Forms]![GetDatesIP]![EndDate]

What would you put in the criteria for the ID field to specify that if
the UserID field is blank, run it for all, or if it has a value in it
(say "U400"), run it for that value?

  #2  
Old November 13th, 2005, 09:58 AM
pietlinden@hotmail.com
Guest
 
Posts: n/a
Default Re: Query through form with or without data specified

this might help
http://www.mvps.org/access/queries/qry0001.htm

  #3  
Old November 13th, 2005, 09:58 AM
Jim
Guest
 
Posts: n/a
Default Re: Query through form with or without data specified

[Forms]![myForm]![myControl] OR [Forms]![myForm]![myControl] Is Null

Works like a charm... thanks mate.

 

Bookmarks

Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles