Re: Message Alert
- From: Steve Sanford <limbim53 at yahoo dot com>
- Date: Tue, 4 Dec 2007 08:56:01 -0800
in the near future. I tried the code you suggested but unfortunately nothing
happened....
OK, I build a table and form and tested the code. The problem was with
spaces in the names.
Here is the modified code:
'----------end code---------------
Private Sub overDue_Click()
'
'Requires: A reference set to Microsoft DAO 3.6 Object Library
'
Dim rs As DAO.Recordset
Dim strOverDue As String
Dim strSQL As String
'Fields:
'Assessment No ' (Autonumber)
'Assessment Date ' (Date)
'To be completed by ' (Date)
'Assessment Status ' (Combo Box) "Proposed" "Complete" "Overdue"
strSQL = "SELECT [Assessment Status], [To be completed by] FROM
[tbl_Main Records]"
strSQL = strSQL & " WHERE [Assessment Status] = 'Proposed' AND [To be
completed by] > #" & Date & "#"
strSQL = strSQL & " ORDER BY [To be completed by];"
' Debug.Print strSQL
'open recordset
Set rs = CurrentDb.OpenRecordset(strSQL)
'check for records
If Not rs.BOF And Not rs.EOF Then
rs.MoveLast
strOverDue = "There are " & rs.RecordCount & " overdue assessments
as of today" & vbCrLf & vbCrLf
strOverDue = strOverDue & "Please check the report"
' strOverDue = "Overdue assessments found. Please view overdue
report"
MsgBox strOverDue
End If
' cleanup
rs.Close
Set rs = Nothing
End Sub
'----------end code---------------
Let me know what happens.......
HTH
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
.
- Follow-Ups:
- Re: Message Alert
- From: Jen
- Re: Message Alert
- References:
- Re: Message Alert
- From: Steve Sanford
- Re: Message Alert
- From: Jen
- Re: Message Alert
- Prev by Date: Re: Use Wordpad or Notepad? Hyperlinks or OLE objects?
- Next by Date: Re: AfterUpdate won't execute
- Previous by thread: Re: Message Alert
- Next by thread: Re: Message Alert
- Index(es):
Relevant Pages
|
Loading