L
Luis
Hello.
I'm trying to create a form with a text box that displays the contents of a
certain recordset with the slidding efect. The solution i've found is
displaying character by character with a certain time interval between then.
The problem is that this only works if the textbox has the focus. Can anyone
give me a hint on solving this? The code i'm using is the following:
Option Compare Database
Private rst_alarmes As DAO.Recordset
Private Declare Sub sapisleep Lib "Kernel32" Alias "Sleep" (ByVal
dwMilliseconds As Long)
Private Sub Form_Load()
Set rst_alarmes = CurrentDb.OpenRecordset("Alarmes", dbOpenSnapshot)
Me.TimerInterval = 10000
End Sub
Private Sub Form_Timer()
If rst_alarmes.EOF Then
rst_alarmes.MoveFirst
str_alarme = rst_alarmes!ElementoRede & " - " &
rst_alarmes!Indicador & " - " & rst_alarmes!Valor & " - " & rst_alarmes!data
tam = Len(str_alarme)
For k = tam To 0 Step -1
retira = tam - k
Valor_t = Left(str_alarme, retira)
Me.AlarmesTxt.Value = Valor_t
Call sSleep(100)
Next k
Else
str_alarme = rst_alarmes!ElementoRede & " - " &
rst_alarmes!Indicador & " - " & rst_alarmes!Valor & " - " & rst_alarmes!data
tam = Len(str_alarme)
For k = tam To 0 Step -1
retira = tam - k
Valor_t = Left(str_alarme, retira)
Me.AlarmesTxt.Value = Valor_t
Call sSleep(100)
Next k
rst_alarmes.MoveNext
End If
End Sub
Sub sSleep(lngMillisec As Long)
If lngMillisec > 0 Then
Call sapisleep(lngMillisec)
End If
End Sub
I'm trying to create a form with a text box that displays the contents of a
certain recordset with the slidding efect. The solution i've found is
displaying character by character with a certain time interval between then.
The problem is that this only works if the textbox has the focus. Can anyone
give me a hint on solving this? The code i'm using is the following:
Option Compare Database
Private rst_alarmes As DAO.Recordset
Private Declare Sub sapisleep Lib "Kernel32" Alias "Sleep" (ByVal
dwMilliseconds As Long)
Private Sub Form_Load()
Set rst_alarmes = CurrentDb.OpenRecordset("Alarmes", dbOpenSnapshot)
Me.TimerInterval = 10000
End Sub
Private Sub Form_Timer()
If rst_alarmes.EOF Then
rst_alarmes.MoveFirst
str_alarme = rst_alarmes!ElementoRede & " - " &
rst_alarmes!Indicador & " - " & rst_alarmes!Valor & " - " & rst_alarmes!data
tam = Len(str_alarme)
For k = tam To 0 Step -1
retira = tam - k
Valor_t = Left(str_alarme, retira)
Me.AlarmesTxt.Value = Valor_t
Call sSleep(100)
Next k
Else
str_alarme = rst_alarmes!ElementoRede & " - " &
rst_alarmes!Indicador & " - " & rst_alarmes!Valor & " - " & rst_alarmes!data
tam = Len(str_alarme)
For k = tam To 0 Step -1
retira = tam - k
Valor_t = Left(str_alarme, retira)
Me.AlarmesTxt.Value = Valor_t
Call sSleep(100)
Next k
rst_alarmes.MoveNext
End If
End Sub
Sub sSleep(lngMillisec As Long)
If lngMillisec > 0 Then
Call sapisleep(lngMillisec)
End If
End Sub