• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

HFlexGrid Bug

When I add a record to a recordset and associate to an empty HFlexgrid control in vb6 it does'nt display properly. I am using a Win 2000 platform with Access 2000 as back-end with ADO recordset
Is there any way to correct it.
0
rprasanna14
Asked:
rprasanna14
  • 2
1 Solution
 
SethiCommented:
Post the code.
0
 
rprasanna14Author Commented:
Here's the code ...
set Hflexgrid.datasource=nothing    
rsShipment.Open "SHAPE {SELECT ShipmentId,Sample.SampleName, ShipmentDetail.Quantity, BranchName, ShipmentDetail.ExpectedDate, ShipmentDetail.Status " & _
            " FROM Sample, ShipmentDetail, CompanyBranch WHERE Sample.SampleId = ShipmentDetail.ItemId AND CompanyBranch.BranchId = ShipmentDetail.Destination AND POID=" & POID & " Order By ShipmentID,ItemId} AS Command2 " & _
            "COMPUTE Command2 BY 'ShipmentID','BranchName','ExpectedDate'", conn, adOpenStatic, adLockReadOnly
set Hflexgrid.datasource=rsshipment

This is empty initially.
Now at runtime I add records and again requery it. Although data gets saved properly, display is'nt correct.
Also, when I stop and re-run the application display gets correct.
0
 
SethiCommented:
This is because when you add records you have refill flexgrdi again. i.e. you will have call this procedure again. When you set the datasource property of the flexgird, it binds the datasource in static manner and it would not notice any changes to the database dynamically. Close the recordset just after this line:
set Hflexgrid.datasource=rsshipment
rsshipment.close

to avoid any error on recalling the sub.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now