MSHFLEX Grid Refresh Problem

04-14-2004, 10:45 AM
hi im just i desparate need of some help here,

I have a MSHFlexgrid and im adding new records to the Database.

I cannot seem for the life of me get the grid to refresh unless I close and re-open the form. which I dont want to do!

I can see that the data has been added to the SQL table but once I add it, I cannot get the Flexgrid to show the newly added record

Ive even tried putting a button on the form to run the statemetn below and it doesnt refresh.

Now here's the odd bit.

If I update the records in the table then press the refresh button the records currently in the grid refrsh but still the new record is not shown!!!

Any ideas PLEASE!!

Dim oRSOrderDetReq As ADODB.Recordset
Dim strConnect As String
Dim strSQLDet As String

strConnect = INI_getString("String", "ConnectString1", App.Path & "\dataconn.ini")

strSQLDet = "Select ISBN, Description, Quantity ,UnitPrice, Discount, Discount_Type,Discount_Amount," & _
"Tax_Code,SalesTax, ExtSalesTax, ExtAmount,Location, Kit_Item,Weight_Ea, ExtWeight, OrderID, Row_ID, Date_Added from Orders_Detail where OrderID = " & frmOrders.OrderID.Text

Set oRSOrderDetReq = New Recordset

oRSOrderDetReq.Open strSQLDet, strConnect, adOpenKeyset, adLockOptimistic

Set MSHFlexOrdDetail.DataSource = oRSOrderDetReq



04-14-2004, 12:06 PM
Set the grid data source to nothing, then set it back and that should refresh it for you.

04-14-2004, 03:25 PM
The MSHFlexGrid is a bound control. You have to reset the datasource in order to see the changes. So, as stated befrore, you need to set it equal to nothing and then re-bind it to the updated DataSource

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum