Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / June 2007

Tip: Looking for answers? Try searching our database.

Open msgbox at Time-hour

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Leire - 05 Jun 2007 15:40 GMT
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
Klatuu - 05 Jun 2007 16:15 GMT
What error are you getting?

For one thing, I would change this line:
 strSQL = strSQL & "WHERE ((Not ([Clientes].[FECHA]) Is Null) AND (Not
([Clientes].[HORA]) Is Null))"

To
 strSQL = strSQL & "WHERE [Clientes].[FECHA]) Is Not Null AND
[Clientes].[HORA] Is Not Null;"
Signature

Dave Hargis, Microsoft Access MVP

> Hi,
> I´m working with Access2003, I have a form of "clients" where I can write  
[quoted text clipped - 37 lines]
>
> Thanks
Leire - 05 Jun 2007 16:51 GMT
I have changed the line, as you mentioned, and now the error I get is (I will
translate it as better I can from spanish):

Microsoft Visual Basic
It has been produced an error '3061' on execution time:
Little (or few) parameters. Supposed to be 3

Finalized - Depurate - Help

> What error are you getting?
>
[quoted text clipped - 47 lines]
> >
> > Thanks
Klatuu - 05 Jun 2007 17:00 GMT
I missed removing one paren.
Try:
   strSQL = strSQL & "WHERE [Clientes].[FECHA] Is Not Null AND
[Clientes].[HORA] Is Not Null;"

The error is saying the query is expecting 3 parameters.
Signature

Dave Hargis, Microsoft Access MVP

> I have changed the line, as you mentioned, and now the error I get is (I will
> translate it as better I can from spanish):
[quoted text clipped - 56 lines]
> > >
> > > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.