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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FlexGrid not refreshing 1

Status
Not open for further replies.

culshaja

Programmer
Aug 10, 1999
705
GB
I have a flexgrid bound to an ADO Data control which has its cursor set to client-side and dynaset type set to dynamic. When I add things to the recordset the flexgrid doesn't show the new items, even if I force a refresh on the data control and the flexgrid. How can I get the flexgrid to show the new records?<br>
<br>
James :)
 
there are two things to keep in mind when adding things &quot;Refresh&quot; and &quot;Requery&quot; to grids or recordset or forms<br>
One or the other works with the FlexGrid's Data source<br>
such as Data1.Requery<br>

 
The flexgrid control does not have a requery method! That was part of the problem. I use refresh on the active data control as that works the same as requerying the underlying recordset. I have also tried using the requeru method on the underlying recordset.<br>
<br>
James :)
 
Use the refresh on the ado control and then use the rebind method of the flexgrid control<br>
<br>
C
 
You're right the flexgrid itself does not have it, but it's data source does.<br>
Thats where you need to do it.<br>
<br>
you mentioned your are using an &quot;ADO Data control&quot; <br>
thats where the RE-xxxxx goes<br>
I tried it out myself.<br>
I have a data control connected to the Biblo.mdb <br>
and it's recordsource connected to 'Authors'<br>
I put a command button on which sends a new recordsource to the data control<br>
here is the code<br>
------------------<br>
Private Sub Command1_Click()<br>
Data1.RecordSource = &quot;Publishers&quot;<br>
Data1.Refresh<br>
<br>
End Sub<br>
-------------------<br>
<br>
Or as &quot;calahans&quot; mentioned Rebind which re-connects it to the updated Data source.<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top