[AccessD] Any easy way to do this?

Gustav Brock Gustav at cactus.dk
Thu Apr 15 01:17:18 CDT 2010


Hi John

That sounds clever. Now you only miss to add sound to the show!

/gustav


>>> jwcolby at colbyconsulting.com 15-04-2010 03:55 >>>
Today we got a system working where I create the base queries in SQL Server, then we load the base 
queries in a list box on a C# form.  From there we use a "mover" paradigm to move them back and 
forth between two other list controls, one which represents the column queries, the other represents 
the row queries.

Once we did that and got inner join code working between the row and column queries, we automated it 
so that code iterated the rows and columns dynamically creating and executing the junction queries 
(inner join between two base queries).

With that happening, we then created a datagrid view, and in code created a table adapter, populated 
it with the correct number of columns (in the col query list) and then populated the table with the 
counts.  Bound the datagridview control and started poking the counts into the resulting table.  It 
is quite a wonder to watch as the junction queries run and populate the table with the counts.

When it is done I can select the data in the table, copy it to the clip board and paste into a 
spreadsheet or email to send to the client.

Other than the time to run the actual counts, this is now a 15 minute exercise to do counts, even 
for quite a large grid of counts.  I got a grid request the other day that was 7 columns by 8 rows, 
56 junction queries, plus 15 base queries.  I still have to create the 15 base queries but now I can 
just select those base queries into the row and column lists and press a button and voila, counts 
start filling in a table.

Quite satisfying to watch.

John W. Colby
www.ColbyConsulting.com 





More information about the AccessD mailing list