[AccessD] Modifying a query

Hale, Jim Jim.Hale at FleetPride.com
Wed Jun 7 15:30:13 CDT 2006


It is modifying it for purposes of opening the recordset. so the SQL looks
something like this:
PARAMETERS areaname Text ( 255 ); SELECT GLMAREA.COMPY, GLMAREA.REGION,
GLMAREA.AREA
FROM GLMAREA WHERE (((GLMAREA.AREA)=[areaname]));

in the code I sent earlier strparameter="areaname" and strCriteria would be
the criteria you can set via a textbox or whatever. In the query grid right
click and select parameter. You can then define the name and data type of
the parameter. on the criteria line type [areaname]. This will create the
sql listed above. You can then feed the parameter the criteria value from
code as desired. HTH
Jim

-----Original Message-----
From: Rocky Smolin - Beach Access Software [mailto:bchacc at san.rr.com]
Sent: Wednesday, June 07, 2006 2:43 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Modifying a query


Thought about it?  I didn't even know about it!  That's the kind of 
thing I would have suspected existed.  But are you actually modifying 
and saving the query or just modifying it for purposes of opening the 
recordset?

Rocky


Hale, Jim wrote:
> Have you thought about using the parameters collection?
> Jim Hale
>
>  Set dbs = CurrentDb
>     Set qdfTemp = dbs.QueryDefs(strQryname)
>     If Not strParameter = "" Then qdfTemp.Parameters(strParameter) =
> strCriteria
>     Set rsRecset = qdfTemp.OpenRecordset()
>
> -----Original Message-----
> From: Rocky Smolin - Beach Access Software [mailto:bchacc at san.rr.com]
> Sent: Wednesday, June 07, 2006 1:06 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Modifying a query
>
>
> P.S.  However, I'm kind of surprised that there's no object model with 
> properties and methods like there is for tables so you could just write 
> something like qry.Field(n).Criteria = ">= xxx".  Why should that be?
>
> Rocky
>
>

***********************************************************************
The information transmitted is intended solely for the individual or
entity to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or
other use of or taking action in reliance upon this information by
persons or entities other than the intended recipient is prohibited.
If you have received this email in error please contact the sender and
delete the material from any computer. As a recipient of this email,
you are responsible for screening its contents and the contents of any
attachments for the presence of viruses. No liability is accepted for
any damages caused by any virus transmitted by this email.


More information about the AccessD mailing list