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

Datagrid and Timer.

Status
Not open for further replies.

gazal

Programmer
Apr 30, 2003
212
0
0
OM
Hi

I have DataGrid with columns like Start Time, End Time, Time Used.

In the Time Used Column I want to show the Difference of Start Time and Current System Time, I have the code and it works fine also. But to update the time i have used Timer which expires every 1 minute. But i have few problems in displaying the Time Used in Data Grid Column.

I have tried two different methods, but both gave me same results.
1) I tried looping thorugh the grid and update the time used column,

2) I tried looping through the under lying recordset of DataGrid and update the Time Used Column.

But both these methods update only the row where the cursor is currently placed,

And as the code is written on Timer, the users can physically see the Record Pointer of Data Grid Dancing from UP TO DOWN.

How can i eliminate these things....

Anyhelp will be appreciated

Gazal
 
You may try setting your datagrid to visible=false for the duration of your calculations then back again. I solved some flicker problems using the above method.

Hope it helps.

Harold

***You can't change your past, but you can change your future***
 
hi harold

as i have mentioned very clearly that my code is written on a Timer which expires every minute, so its practically impossible for me to set the visible property on/off.

any other suggestions???


gazal
 
Hi gazal
I took faced the same problem with one of my apps. Drove me nuts trying to figure it out.
I finally tried disabling the grid when the timer fires, perform the update on the grid and then re-enabled the grid. This prevented the pointer running around like the mad hatter.
Hope this helps.
[bigcheeks]
 
Try using a recordset clone:

Dim rsClone As ADODB.Recordset
Set rsClone = rsMain

rsClone.MoveLast

MsgBox rsMain.Fields(0).Value
MsgBox rsClone.Fields(0).Value

 
wow that sounds logical and workable too

Thanks CCLINT let me try and get back to u... cloning may work...

gazal
 
Sorry, there was a typo:

Set rsClone = rsMain.Clone
 
Can I assume that this is working for you now?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top