[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

HFlexGrid Bug

Posted on 2003-10-28
5
Medium Priority
?
187 Views
Last Modified: 2010-05-03
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
Comment
Question by:rprasanna14
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 18

Expert Comment

by:Sethi
ID: 9647156
Post the code.
0
 

Author Comment

by:rprasanna14
ID: 9647796
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
 
LVL 18

Accepted Solution

by:
Sethi earned 250 total points
ID: 9648106
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question