[AccessD] When a query refers to a control on a form which isnot open - how to supply a default?

jwcolby jwcolby at colbyconsulting.com
Wed Jun 2 12:58:36 CDT 2010


ROTFL.

 > My choice appears to be VBA or VBA or VBA ... rather than VBA or more
 > flexible SQL...?

SQL is not flexible, that is why each company has SQL "extensions" for their database engine.

John W. Colby
www.ColbyConsulting.com


Bill Benson (vbacreations) wrote:
> Doug, not sure how to implement this? The query is "out there" as an object
> in the database; it is used as a recordsource for a subform ... how am I
> supposed to let code control it? I am not using any code?
> 
> On the other hand if what you mean is that I should set a parameter equal to
> a function which code I have controlled - well that is the same thing as
> others are suggesting.
> 
> My choice appears to be VBA or VBA or VBA ... rather than VBA or more
> flexible SQL...?
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Doug Steele
> Sent: Wednesday, June 02, 2010 10:11 AM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] When a query refers to a control on a form which
> isnot open - how to supply a default?
> 
> Change the query to a parameter query; then your code controls the value
> that is passed to the query.
> 
> Doug
> 
> On Tue, Jun 1, 2010 at 3:43 PM, Bill Benson (vbacreations) <
> vbacreations at gmail.com> wrote:
> 
>> SELECT TblCIB.RecordID, TblCIB.ShopOrder, TblCIB.ItemNumber FROM TblCIB
>> WHERE (((TblCIB.RecordID)=[Forms]![frmExciterIndividualEntry]![RecordID]))
>>
>> The above sql is causing the user to be prompted for a value of
>> [Forms]![frmExciterIndividualEntry]![RecordID] when that form is not open
>> and/or the control not populated. I would like that when there is no form
>> or
>> control available at runtime, the query just assumes a 0 or "" [default]
> so
>> that my users are not prompted. Is there some simple [single expression]
>> way
>> to do this short of the workaround I show below, which seems like
>> overkill??
>>
>>



More information about the AccessD mailing list