Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

757 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

22 Experts available now in Live!

Get 1:1 Help Now