[AccessD] combo box 101

Darryl Collins darryl at whittleconsulting.com.au
Wed Aug 10 18:13:06 CDT 2011


I would even go the extra step and say dynamic as you will populate
different values based on a user choice somewhere else.  It is easy to do
this in the VBA code and very clear to read.

I much prefer to write the in SQL as it makes debugging much easier as you
can see immediately what is going on.  If you are using a query, or worse,
nested queries, then I find it a real PITA to get to the source of the data.
But we are all different and like thing different ways.  No right or wrong
really I guess.



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Thursday, 11 August 2011 3:17 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] combo box 101

I call SQL generated by VBA code "dynamic code" because it is "dynamically
generated" as opposed to 
generated by the developer at design time.

John W. Colby
www.ColbyConsulting.com

On 8/10/2011 12:57 PM, William Benson wrote:
> John what does "dynamic SQL in the control itself" mean?
> On Aug 10, 2011 2:00 AM, "jwcolby"<jwcolby at colbyconsulting.com>  wrote:
>> I find all of these arguments valid however I also use Rick Fisher's Find
> and Replace which can find
>> unused objects and allow me to delete them. When you start manipulating
> the query in code then
>> dynamic sql in the control itself seems superior in most cases.
>>
>> John W. Colby
>> www.ColbyConsulting.com
>>
>> On 8/9/2011 9:44 PM, Stuart McLachlan wrote:
>>> On 9 Aug 2011 at 21:04, William Benson (VBACreations. wrote:
>>>
>>>> I think those who are comfortable with a lot of queries in their
>>>> database -- which there is no easy way to tell where that query is
>>>> being used, either in rowsources or in dependent queries ... probably
>>>> work in very stable object environments.
>>>>
>>>
>>>
>>> That's my main concern too.
>>>
>>> If you only use queries in VBA, it is easy to search and tabulate all
> occurences of a query
>>> name so that you can easily determine all the places it is used. That
> means that you can
>>> ensure that it is safe to modify/delete queries.
>>>
>>> If however you use them as the source of various controls/forms/reports
> it is MUCH harder to
>>> determine whether it is safe to modify/delete a query.
>>>
>>> 1. I've deleted this combobox on this form. Can I delete the query that
I
> used to populate it or
>>> is it used by another combobox somewhere on another form/report?
>>>
>>> 2. Users now want this combobox on this form sorted by firstname instead
> of lastname.
>>> Can I safely change the sort order of the query - Is the same query used
> in another
>>> combobox on another form?
>>> Do I have to create a new one query for this combobox or is there
another
> query somewhere
>>> already that does this which I can use instead?
>>> If I use a different query, can I safely delete the old one or is it
> still in use elsewhere?
>>>
>>> 3. There have been a number of changes made to various components of the
> application.
>>> Which of these queries are still in use somewhere and which should be
> deleted?
>>>
>>>
>> --
>> AccessD mailing list
>> AccessD at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/accessd
>> Website: http://www.databaseadvisors.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list