Home All Groups Group Topic Archive Search About
Author
1 Feb 2006 6:29 PM
Dave
Hello,
I'm working on a scheduling application for a department at work and I
have a need to load each week and task into a FlexGrid in a manner
that's different than presented in the recordset. For example:
Data as represented in the recordset might be something like

Position1,Shift1,Name1,Date1
Position2,Shift2,Name2,Date2

I would like the Dates to be my column headers, the Positions to be row
headers, and each shift/name will be in each corresponding cell (Shift
and Names will be combined for display purposes) I'd like the gird to
appear like (I hope this renders correctly)

        Date1        Date2
Position1    Hours1/Name    Hours1/Name
Position1    Hours2/Name    Hours2/Name
Position2    Hours1/Name    Hours1/Name

etc...

Each Position could have any number of shifts for any given day. I do
have an algorithm that does what I want, but it makes many many queries
to the database tables involved and takes almost 1/2 second (even with
the grid Redraw off). I was thinking of just getting all the data for
the week at one time sorted by Position and Date, and then looping
through the data myself. Any thoughts on this?

THanks,
-Dave

Author
1 Feb 2006 8:17 PM
Ken Halter
"Dave" <dav***@sbcglobal.net> wrote in message
news:%23045y11JGHA.2864@TK2MSFTNGP10.phx.gbl...
> ............. I was thinking of just getting all the data for the week at
> one time sorted by Position and Date, and then looping through the data
> myself. Any thoughts on this?
>
> THanks,
> -Dave

That's the "recommended" way to work with data. Using "Databound" controls
takes about 99.9% of the control your app has over the data, away from you.

imo, just Clear the grid, use TextMatrix to set the column/row headers, loop
through the recordset and use TextMatrix to set specific cells = specific
data. 100% (or as close as you can get with that grid) control over the data
and display is yours again.

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Freeware 4 color Gradient Frame? http://www.vbsight.com/GradFrameCTL.htm
Author
1 Feb 2006 9:40 PM
Dave
Ken,
Yes,this application is entirely unbound except for a couple of
DataReports. MUCH more control and flexibility. :)

With this scheduling grid, my issue is determining which cell each
record goes into.  I have a complete mental block on this.


Ken Halter wrote:
Show quoteHide quote
> That's the "recommended" way to work with data. Using "Databound" controls
> takes about 99.9% of the control your app has over the data, away from you.
>
> imo, just Clear the grid, use TextMatrix to set the column/row headers, loop
> through the recordset and use TextMatrix to set specific cells = specific
> data. 100% (or as close as you can get with that grid) control over the data
> and display is yours again.
>
Author
2 Feb 2006 5:15 AM
Dave
Ah-ha!  I finally got it sorted out with much cussing and a lot of
coffee. But that's what programming is all about isn't it? ;)

-Dave