Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing DataGrid 1

Status
Not open for further replies.

Mukesh2375

Programmer
Jan 31, 2003
19
0
0
IN
I created a DataGrid on a form using a recordsource.
on clicking on the grid i invoke a form where i accept some inputs that update the recordset in the DataGrid. In order to refresh the DataGrid I called
rs.Update
rs.Resync adAffectCurrent, adResyncAllValues
rs.SetupGrid.Requery

but this changes the width of columns of the DataGrid I have created. What should i do to refresh the data in the DataGrid so that the appearance (i mean width of columns) of the DataGrid do not change.

Mukesh
 
If you used the same recordset for your input form as you do for the datasource of the data grid, you wouldn't need to requery.
But, maybe you are updating the database with an action query and the datagrid's recordsource is read only or disconnected from the data source.
If not, then maybe you should disconnect the data grid's recordset from the datasource, make it read only, and then as you update the datasource through the input form, you can just update the grid's underlying [disconnected] recordset.

If you must requery, then:

DataGrid1.HoldFields
rsADO.Requery
DataGrid1.Rebind
 
thanx CCLINT, its working fine. .HoldFields is the method i wasn't aware of.

Thanx once again and regards.

Mukesh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top