Click to See Complete Forum and Search --> : Filling dynamically a flexgrid
Henk
May 2nd, 2000, 01:37 AM
How can I fill a Flexgrid through a query or SQL with dates in the header ? I tried it many ways, but VB won't take any variables to read the header. I use a parameterquery with 3 parameters :Name, startdate and Enddate. This works perfect in Access. The only way it works is like this : recordset![01/05/2000]. Because the grid is subject to change every day, this won't work.
Anyone any idea ?
Thanks
Henk
May 2nd, 2000, 11:04 PM
Actual situation : I tried to fill a flexgrid calling a crosstabquery with 3 variables : Name, Begindate and Enddate. This works perfect in Access. The only way it worked was RECORDSET![01/05/1999] but this I cannot use ofcourse.
Problem : I didn't knew how to call the columheaders in VB because each day the result is different.
I tried : several date-functions, strings, via textboxes, ... . I usually call the columheader like this : RECORDSET!FIELDNAME. This has several advantages : the number of colums may vary, you can move the colums, ... . It should be the proper way to program (at least that was what i was teached).
Solution : It was so obvious that I didn't see it. Still it was one of the first things to learn programming databases. Try RECORDSET.fields(x). Where x is the number of the colum. Be carefull not to change the query or the colums !
Hopefully this helps someone.
PS :Glenn, thanks for your reaction but I use several function for the calling query and the flexgrid. It's a program with several grids. That's why it would take a lot of space in order to understand what I wrote. Thanks anyway.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.