Kamis, 03 Mei 2012

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]

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar