 | Junior Member with 28 posts. | | Join Date: Nov 2009 Experience: Beginner | | Track due date of submissions Hi there,
Need help on this, please. The problem is i need to track the due date of documents submissions and auto alert via e-mail + popup message. I have a field name [ID], [File Number], [Unit No], [Unit Name], [Meeting-means starting date] and [Alert- means due date]. Every submissions tracking starts on meeting date and 14 days after the start date is the due date. I need to track the due date after the meeting and alert me and my colleagues via e-mail alert + popup message additional if possible. My apologies for my english and explanation, just a noob. Please I really need this to work. Thanks  . | | Moderator with 18,661 posts. | | Join Date: Oct 2003 Location: Surrey, UK Experience: Intermediate | | what application are you using ??
Excel, access,SQL, other - please specify | | Distinguished Member with 9,339 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer | | | | | Junior Member with 28 posts. | | Join Date: Nov 2009 Experience: Beginner | | Quote:
Originally Posted by OBP | Sorry guys I forgot to mentioned, I'm using Access 2007 and not much familiar with the code.
OBP I saw that already, the first link above but im a bit confused.
Thanks! | | Distinguished Member with 9,339 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer | | Well I can't work in Access 2007, but if you can save the database in Access 2003 format and email me a zipped copy I can do it for you.
Or if you Post it as a zipped attachment on here I or one of the other posters can take a look for you.
Just ensure that it does not contain any Personal Data.
I have to go soon ( I am in the UK) as my wife kicks me off the Computer in the evenings, I have already been on here for 9 hours.
__________________ OBP
I do not give up easily | | Junior Member with 28 posts. | | Join Date: Nov 2009 Experience: Beginner | | That was really great help, many thanks. I'll zipped a copy and send it. | | Distinguished Member with 9,339 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer | | I have private mailed you my email address.
I will post the VBA code that we use so that others can see it. | | Junior Member with 28 posts. | | Join Date: Nov 2009 Experience: Beginner | | That's pretty cool and seems great to me. | | Distinguished Member with 9,339 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer | | Vikerz, I have emailed you a question about the automatic email alert. | | Junior Member with 28 posts. | | Join Date: Nov 2009 Experience: Beginner |
04-Nov-2009, 05:23 PM
#10 | Quote:
Originally Posted by OBP Vikerz, I have emailed you a question about the automatic email alert. | I got your e-mail and I already reply on it. Cheers! | | Distinguished Member with 9,339 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer |
09-Nov-2009, 12:21 PM
#11 | For anybody interested in doing something similar here is the VBA code in the Form that send data from various queries to an Emailing Module Code: Private Sub Form_Load()
On Error GoTo errorcatch
filename = "OneDayEmails"
rep = "1"
Call sendemails(filename, rep)
filename = "TodaysEmails"
rep = "2"
Call sendemails(filename, rep)
filename = "ThreeDayEmails"
rep = "3"
Call sendemails(filename, rep)
MsgBox "done"
Exit Sub
errorcatch:
MsgBox Err.Description
End Sub
Here is the VBA Code in the Module that sends the VBA code to the Person in the Record in a field called initials and a copy (in a different format) to the administrator. Code: Public filename As String, rep As String
Public Sub sendemails(filename As String, rep As String)
Dim subject As String, Body As String, EmailAddress As String, emailadmin As String, adminbody As String, adminsubject As String
Dim rs As Object, recount As Integer, count As Integer, rst As Object, initrecount As Integer, initcount As Integer
Dim sql As String
On Error GoTo errorcatch
Set rst = CurrentDb.OpenRecordset("IntitialsQuery")
rst.MoveLast
rst.MoveFirst
initrecount = rst.RecordCount
For initcount = 1 To initrecount
EmailAddress = rst![emailAddress]
subject = ""
Body = rst![Name] & "," & Chr$(13) & Chr$(13)
sql = "SELECT * " & _
"FROM " & filename & _
" WHERE Initials = '" & rst![InitialID] & "'"
Set rs = CurrentDb.OpenRecordset(sql)
If rs.RecordCount > 0 Then
rs.MoveLast
rs.MoveFirst
recount = rs.RecordCount
For count = 1 To recount
subject = subject & rs![File Number] & " "
Body = Body & "FILE NUMBER: " & rs![File Number] & Chr$(13) & "UNIT NUMBER: " & rs![Unit No] & Chr$(13) & "UNIT NAME: " & rs![Unit Name] & Chr$(13) & Chr$(13)
rs.MoveNext
Next count
Body = Body & "Drawings submission is due on " & Date + 1
Body = Body & ". This is Report (" & rep & "). Please do the needful within this day." & Chr$(13) & Chr$(13) & "Thank you!" & Chr$(13) & Chr$(13) & "Administrator"
'MsgBox subject & vbNewLine & Body
End If
rs.Close
If subject <> "" Then DoCmd.SendObject , , , EmailAddress, , , subject, Body, False
rst.MoveNext
Next initcount
'MsgBox subject & vbNewLine & Body
Set rs = CurrentDb.OpenRecordset(filename)
adminbody = "Administrator, please note. " & Chr$(13) & Chr$(13)
emailadmin = "email goes here"
If rs.RecordCount > 0 Then
rs.MoveLast
rs.MoveFirst
recount = rs.RecordCount
For count = 1 To recount
adminsubject = adminsubject & rs![File Number] & " "
adminbody = adminbody & "FILE NUMBER: " & rs![File Number] & Chr$(13) & "UNIT NUMBER: " & rs![Unit No] & Chr$(13) & "UNIT NAME: " & rs![Unit Name] & Chr$(13) & Chr$(13)
rs.Edit
If rep = "1" Then rs!emailalertsent1 = -1
If rep = "2" Then rs!emailalertsent2 = -1
If rep = "3" Then rs!emailalertsent3 = -1
rs.Update
rs.Bookmark = rs.LastModified
rs.MoveNext
Next count
adminbody = adminbody & "Drawings submission is due on " & Date + 1 & Chr$(13) & Chr$(13)
'MsgBox adminsubject & vbNewLine & adminbody
DoCmd.SendObject , , , emailadmin, , , adminsubject, adminbody, False
End If
rs.Close
Set rs = Nothing
rst.Close
Set rst = Nothing
Exit Sub
errorcatch:
MsgBox Err.Description
End Sub
Note it uses 2 Public Variables, filename and rep to pass the data to the Module
__________________ OBP
I do not give up easily
Last edited by OBP : 10-Nov-2009 08:48 AM.
| | Distinguished Member with 6,294 posts. | | Join Date: Oct 2004 Location: Southwest Iowa.... Experience: Currently stupid... |
09-Nov-2009, 12:34 PM
#12 | Quote:
Originally Posted by OBP I have to go soon ( I am in the UK) as my wife kicks me off the Computer in the evenings, I have already been on here for 9 hours.  | That is probably good for you, OBP! Make sure she takes care of you - you know, we old guys need to eat and stuff.... | | Distinguished Member with 9,339 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer |
09-Nov-2009, 12:38 PM
#13 | Eating, mmmm, damn, is that where I have being going wrong then. | | Distinguished Member with 6,294 posts. | | Join Date: Oct 2004 Location: Southwest Iowa.... Experience: Currently stupid... |
09-Nov-2009, 12:47 PM
#14 | Yep - ya know, you can't run on electrons all day! | | Junior Member with 28 posts. | | Join Date: Nov 2009 Experience: Beginner |
15-Nov-2009, 11:04 AM
#15 | Hey OBP, TWO Thumbs   for your work and really work smooth in A2007. The best, Cheers!
Last edited by Vikerz : 15-Nov-2009 11:12 AM.
| |
Smart Search
| Find your solution! | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |  WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
| You Are Using: |
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 02:29 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd. | |
|