Solved

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

Posted on 2004-08-03
3
234 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now