Results 1 to 2 of 2

Thread: Filling dynamically a flexgrid

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    2

    Angry

    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

  2. #2

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    2

    Wink

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width