al4629740
asked on
update the datagrid
On the close event, I want to make sure my datagrid has all the data updated with the database. What code do I need to do this?
Is this vb6? What DataGrid control are you using?
ASKER
The basic grid, not the Flex Grid. This is vb6
ASKER
datagrid control 6.0
If your talking about Component Ones TrueGrid you would simply ReBind the grid to your data source.
ASKER
how do i do that?
If your talking about refreshing the grid based on the data in the database changing your would do this:
DataGrid.Refresh
DataGrid.ReBind
If your talking about update the database based on data changing in the grid you would use the _AfterUpdate event and update the database from the changed column values.
DataGrid.Refresh
DataGrid.ReBind
If your talking about update the database based on data changing in the grid you would use the _AfterUpdate event and update the database from the changed column values.
ASKER
I want to update based on data changing in the grid. Would this work after closing the screen?
Private Sub Form_Unload(Cancel As Integer)
DataGrid.ReBind
End
End Sub
Private Sub Form_Unload(Cancel As Integer)
DataGrid.ReBind
End
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok, so it does fire anyways after closing the form? I didn't know that.