Connecting Tech Pros Worldwide Help | Site Map

Query through form with or without data specified

  #1  
Old November 13th, 2005, 09:58 AM
Jim
Guest
 
Posts: n/a
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

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

re: Query through form with or without data specified


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

Works like a charm... thanks mate.

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Next record in one-to-many relationship? Tony Dunn answers 1 March 3rd, 2007 07:55 PM
Asp.net Important Topics. shamirza answers 0 January 18th, 2007 05:15 AM
VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help gunimpi answers 0 January 10th, 2007 08:55 PM
query string encoding/decoding Mark answers 9 November 18th, 2005 08:54 AM