Jumat, 17 Mei 2013

RE: [MS_AccessPros] Form - Parameter Query

 

Hello John,

Thank you..

Just a small clarification, the "MyField" on your below expression, would
you please feed me more info on this. What is this field, it is not that am
I only filling out the txtFirstName control from my form and it will be use
in underlying query as criteria?

How could I use in my query filter? Should I just put the below expression
in the criteria row of my FirstName? And another in my criteria row for the
LastName?

Thank you for your kind help,

Zjubias

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of John Viescas
Sent: Friday, May 17, 2013 4:22 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: RE: [MS_AccessPros] Form - Parameter Query

ZJubias-

If you want to treat a "blank" criteria as no filter (all records), then you
must do:

WHERE ((MyField = [forms]![frmEnterParameter]![txtFirstName]) OR
([forms]![frmEnterParameter]![txtFirstName] IS NULL))

That works for up to about three parameters in a query like this, but you'll
probably get "query too complex" if you try to do more than three. If you
need more than three like this, it's best to write code to build a dynamic
filter.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
[mailto:MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> ] On Behalf Of ZJUbias
Sent: Friday, May 17, 2013 12:03 AM
To: MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com>
Subject: [MS_AccessPros] Form - Parameter Query

Hello all,

Can someone please clarify my concerns;

If I created a form to get user fills the search criteria like below format,
I know that if I put these expression to my query criteria row I will get
the desired record. But what if, the user failed to filled out one of the
criteria? What happen, what is the result?.

This kind of approach, is it good/suitable for a multi-field criteria to use
on search form? If not what is the best for multi-field criteria search
approach, considering that maybe one or two field will contain a blank
criteria..

[forms]![frmEnterParameter]![txtFirstName]

[forms]![frmEnterParameter]![txtSurname]

Thank you in advance,

Zjubias

[Non-text portions of this message have been removed]

------------------------------------

Yahoo! Groups Links

[Non-text portions of this message have been removed]

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (8)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar