Refresh Forms

Dina01

Registered User.
Local time
Today, 13:25
Joined
Apr 24, 2002
Messages
87
Hello,

I have a db that is for a multi user environment. But I noticed that if 2 users have it open at the same time, and the I click on a button to terminated a call, well the other user is still able to see that call. I have a timer set to 20 000, but the only way that the call disappear from the screen is by clicking on the refresh button...Why doesn't my refresh make the whole call disappear...

Here is my vode under the timer interval
************


Private Sub Form_Timer()

Dim dbs As Database
Dim rst As Recordset

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("qryDispatchAll")

If rst.RecordCount >= 1 Then

Me.DataID.Requery
Me.Evenement.Requery
Me.Categorie.Requery
Me.Descriptions.Requery
Me.Lieux.Requery
Me.Niveau.Requery
Me.Emplacement.Requery
Me.Precision.Requery
Me.txtHrsDebutCall.Requery
Me.txtHrsEnAttenteCall.Requery
Me.Agent.Requery
Me.Texte79.Requery
Me.Texte82.Requery
Me.Texte83.Requery
Me.txtClock.Requery
Me.txtBlack1.Requery
Me.txtBlack2.Requery
Me.txtBlack3.Requery
Me.txtBlack4.Requery
Me.txtBLue.Requery
Me.txtGreen.Requery
Me.txtGrey.Requery
Me.txtRed.Requery

Else
'NOTHING

End If
End Sub

************************

Can anyone please help..
 
Why not use Me.Requery or Me.Refresh instead of all the individual requerying you're doing?
 
Hey Jeff,

I replaced everything with

*************
Private Sub Form_Timer()

Dim dbs As Database
Dim rst As Recordset

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("qryDispatchAll")

If rst.RecordCount >= 1 Then

DoCmd.RunCommand acCmdRefresh

Else
'NOTHING

End If
End Sub
****************

But I still have the same problem it doesn't refresh automatically without me having to click on the refresh button..
 
Do you have the database split with tables in one file (the Back End) and everything else (the Front End) in another file with the tables linked to it - a copy of which is placed on both users' machines?

If not you need to split your database.

If you have a split database I suggest you check that the code you have is actually firing ...

Put something like msgbox "1", msgbox "2" in the various sections and run things again. The message boxes should pop up showing you what's going on.
 

Users who are viewing this thread

Back
Top Bottom