Solved

HFlexGrid Bug

Posted on 2003-10-28
5
176 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
  • 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 125 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Window placement 17 65
Use Multiple Forms 4 38
Link a textbox in excel to a cell with more than 255 characters. 5 52
Vb.net 2008 2 51
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

762 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now