?
Solved

HFlexGrid Bug

Posted on 2003-10-28
5
Medium Priority
?
184 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 …
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…
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

764 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