Solved

How do I use TrueFalse function in the argument where for a query

Posted on 2004-08-03
3
237 Views
Last Modified: 2012-05-05
I have a form where user can input restriction.

Like "show me date from XXXXXX(input) to XXXXXX(input) "
Then I use what's in the form to query the database (table transaction) with the where argument

In the creation view of the query, I would like to use the WHERE argument and put something like

Field : .Transaction.TransactionDate
Table : Transaction
Order : ASC
Show : No
Where : TrueFalse(Form![formname]![fromdate] Is Null;Display All;>=Form![formname]![fromdate]) AND  TrueFalse(Form![formname]![todate] Is Null;Display All;<=Form![formname]![todate])

the default value of the field on the form is Null or "" or blank, I want the query to restrict to the input only if a value has been entered.
I have a number of input restriction but I just need to know the general idea of what it's suppose to look like.

Can someone help me with that?
0
Comment
Question by:BrunoTremblay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 26

Expert Comment

by:dannywareham
ID: 11707160
Enclose your query field with nz(query field)

This caputres all nulls
0
 

Author Comment

by:BrunoTremblay
ID: 11707273
and what does it do like, I'll look for it
0
 
LVL 44

Accepted Solution

by:
GRayL earned 500 total points
ID: 11707828
Field: iif((Forms!FormName!FromDate + Forms!FormName!ToDate) is Null,"",
[TransactionDate] Between Forms!FormName!FromDate and Forms!FormName!ToDate)
Table: Transaction
 Order: ASC
Show: No
Criteria: <> False

I know it looks strange but it worked with my test case. I do not know if the todate and fromdate identifiers have to be wrapped in date delimteres (#). Try it this way first and if it doesn't work we can try the delimiters.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question