G
Guest
Hi,
I´m working with Access2003, I have a form of "clients" where I can write
"time" and "date" when I want to call back to each one. Right now, the msgbox
only appears if I have the form of that customer open on the screen, so I
have to run everyone to know if there is any call. Right now I have this
Private Sub Form_Timer()
If [hora] = TimeValue(Now()) Then
MsgBox "abrir agenda!!!!"
End If
End Sub
But what I need , is to open the msgbox even if I´ve other customer or form
on the screen. So I´m trying the following:
Dim rs As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT [Clientes].[TELEFONO],[Clientes].[FECHA],
[Clientes].[HORA] "
strSQL = strSQL & "FROM [Clientes] "
strSQL = strSQL & "WHERE ((Not ([Clientes].[FECHA]) Is Null) AND (Not
([Clientes].[HORA]) Is Null))"
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
Do While Not rs.EOF
If rs![FECHA] = DateValue(Now()) And rs![HORA] = TimeValue(Now()) Then
MsgBox "Debe Llamar al numero " & rs![TELEFONO], vbInformation, "AGENDA
PENDIENTE"
rs.MoveNext
End If
Loop
rs.Close
But it gives me an error on: "Set rs = CurrentDb.OpenRecordset(strSQL,
dbOpenDynaset)"
I really don´t know how can I get it right. If somebody knows about, please
let me know.
Thanks
I´m working with Access2003, I have a form of "clients" where I can write
"time" and "date" when I want to call back to each one. Right now, the msgbox
only appears if I have the form of that customer open on the screen, so I
have to run everyone to know if there is any call. Right now I have this
Private Sub Form_Timer()
If [hora] = TimeValue(Now()) Then
MsgBox "abrir agenda!!!!"
End If
End Sub
But what I need , is to open the msgbox even if I´ve other customer or form
on the screen. So I´m trying the following:
Dim rs As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT [Clientes].[TELEFONO],[Clientes].[FECHA],
[Clientes].[HORA] "
strSQL = strSQL & "FROM [Clientes] "
strSQL = strSQL & "WHERE ((Not ([Clientes].[FECHA]) Is Null) AND (Not
([Clientes].[HORA]) Is Null))"
Set rs = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
Do While Not rs.EOF
If rs![FECHA] = DateValue(Now()) And rs![HORA] = TimeValue(Now()) Then
MsgBox "Debe Llamar al numero " & rs![TELEFONO], vbInformation, "AGENDA
PENDIENTE"
rs.MoveNext
End If
Loop
rs.Close
But it gives me an error on: "Set rs = CurrentDb.OpenRecordset(strSQL,
dbOpenDynaset)"
I really don´t know how can I get it right. If somebody knows about, please
let me know.
Thanks