Minggu, 06 Mei 2012

Bls: [MS_AccessPros] Passing Variable Value to QBE grid

 

Thank you John, really helpfull information...
If i have a query like below :

SELECT T_PAID.Date
FROM T1_PAID
WHERE (((T_PAID.Date) Between [Forms]![F2_Dialog LAP]![Date1] And [Forms]![F2_Dialog LAP]![Date2]));

What will access do with that sql command ? :
Get all the records in T_PAID from the server and then filter it with the criteria on the client, or
Filter it first in the server and retrieve the records that we want just like the criteria.

Can we say that restrict the record with [Forms]![F2_Dialog LAP]![Date1] is a standard sql command..?

Regards
Hendra

________________________________
Dari: John Viescas <JohnV@msn.com>
Kepada: MS_Access_Professionals@yahoogroups.com
Dikirim: Senin, 7 Mei 2012 3:59
Judul: RE: [MS_AccessPros] Passing Variable Value to QBE grid


 
Hendra-

1) Access does not "compile" PTQ, so building a PTQ in code loses nothing.

2) A PTQ is faster if it is executing a Stored Procedure on the server. If it's a "regular" query, there's little difference.

3) That is correct.

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

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

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Agestha Hendra
Sent: Sunday, May 06, 2012 9:40 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Bls: [MS_AccessPros] Passing Variable Value to QBE grid

John...

Thanx for the link, i will learn it...
I have 3 question here :
1. About Query On the Fly :
Is Queries On The Fly compiled to like Regular Queries..? As we know the advantage of Regular Queriesis they are compiled,
so Queries are faster than using Sql in VBA.
2. About Pass Through Query (PTQ) :

Is PTQ always faster than Regular Query ? (note : with same sql command)

3. I've read that Access Regular Query will send the sql command directly to the server (the same as the PTQ behave)
as long as the sql command is standard (the sql command is not contain Access specific syntax/expression).

If that right, i think we don't need to use PTQ if the sql command is standard...we can't use Regular Query.

Hope my words is not make you confuse, please explain me...thank you.

Regards
Hendra

________________________________
Dari: John Viescas <JohnV@msn.com>
Kepada: MS_Access_Professionals@yahoogroups.com
Dikirim: Senin, 7 Mei 2012 1:12
Judul: RE: [MS_AccessPros] Passing Variable Value to QBE grid

Hendra-

It's not easy. Basically, you have to modify the pass-through query on the fly to set the value passed to the server. Maybe this will help:

http://support.microsoft.com/kb/131534

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

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

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Agestha Hendra
Sent: Sunday, May 06, 2012 6:04 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Bls: [MS_AccessPros] Passing Variable Value to QBE grid

John...

How do we can do it to Pass Through Queries..?

Regards
Hendra

________________________________
Dari: John Viescas <JohnV@msn.com>
Kepada: MS_Access_Professionals@yahoogroups.com
Dikirim: Kamis, 3 Mei 2012 21:06
Judul: RE: [MS_AccessPros] Passing Variable Value to QBE grid

Dan-

Yes, you can do it using a Parameter, but you'll have to add it in query design
after you create your query in the Wizard. Let's assume your form is named
frmPersonnel, and the option group is named optGender. Under the StaffGender
field in query design, put this on the criteria line:

[Forms]![frmPersonnel]![optGender]

That will filter the rows returned based on the value selected on the form.

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

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

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Dan Fielding
Sent: Thursday, May 03, 2012 2:37 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Passing Variable Value to QBE grid

Is it possible to pass the value stored in a variable to a criteria box in a
Query designed using the Query Design Wizard?

For example, let's say I have an option button group on a Form for male or
female and a variable (gender) that stores the result of the gender selection.
I create a Query using the Wizard that has a field called StaffGender from the
table. I want to store what was selected on the Form and then pass what was
selected to the Query so I only see the records of either the males or females.
Can I pass the contents of the gender variable to the criteria spot under the
StaffGender item in my Query?

Dan

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

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

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

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

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar