4 Replies - 7211 Views - Last Post: 05 June 2009 - 07:33 AM Rate Topic: -----

#1 leang86  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 25-May 09

Refresh Datagrid

Post icon  Posted 02 June 2009 - 08:52 PM

Hi, i'm facing a problem, i have a datagrid in a form, when i update data by using ado, it won't make any changers at my datagrid, until i restart my program, is it have any keyword or function can make the datagrid always up to date? and i have try this code:

[code]
datagrid1.refresh
[\code]

but it didn't make any changers also.
please help me....
Is This A Good Question/Topic? 0
  • +

Replies To: Refresh Datagrid

#2 sloanthrasher  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 18
  • Joined: 31-May 09

Re: Refresh Datagrid

Posted 02 June 2009 - 09:05 PM

View Postleang86, on 2 Jun, 2009 - 07:52 PM, said:

Hi, i'm facing a problem, i have a datagrid in a form, when i update data by using ado, it won't make any changers at my datagrid, until i restart my program, is it have any keyword or function can make the datagrid always up to date? and i have try this code:

[code]
datagrid1.refresh
[\code]

but it didn't make any changers also.
please help me....

Have you tried to add DoEvents after the datagrid1.refresh?
Was This Post Helpful? 0
  • +
  • -

#3 leang86  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 25-May 09

Re: Refresh Datagrid

Posted 03 June 2009 - 01:06 AM

How to add DOEvents? Can you give me an example?
Was This Post Helpful? 0
  • +
  • -

#4 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: Refresh Datagrid

Posted 03 June 2009 - 02:23 AM

just call

doevents



before you call this,
just requery the datagrid's Recordset
Was This Post Helpful? 0
  • +
  • -

#5 jpeters66  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 03-June 09

Re: Refresh Datagrid

Posted 05 June 2009 - 07:33 AM

Try using it with the ado data control as the datasource:
   rs_DataSource.MoveFirst
   Set DataGrid1.DataSource = Adodc1
   Set Adodc1.Recordset = rs_DataSource
   Adodc1.Refresh
   DataGrid1.Refresh


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1