Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Send Email    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Email recording ability
Greg Rosoff 
     
4 years ago
Hello, another email question.  So, I was able to create the emails but is there a way to capture a date/time stamp in the table that provided the email data (tracking terminated system users)?

The terminated user data is in a linked table [tbl_Terminated_System_Users_Log] and I've not been successful with adding the following to the script based on your input above:

DoCmd.RunSQL "INSERT INTO tbl_Terminated_System_Users_Log
(Research_Initiated_Date) VALUES (Date())"

I'd gladly send the whole script if that helped.

Juan C Rivera  @Reply  
            
4 years ago
Access Advanced Level 6
Try data Macros and Create a Log Table
Greg Rosoff OP  @Reply  
     
4 years ago
I appreciate that.  I'm not certain how to go about that.  I have to log/track all the emails the script that Richard developed 17 months ago for our auditors (FISCAM/ICAM) and am hoping he or someone else has a quick way to automatically generate a time/date stamp for when each email is created.
Greg Rosoff OP  @Reply  
     
4 years ago
Ideally, it would be embedded within the same script.  My challenge is I don't know how to modify a record set and then record that modification onto the underlying table.
Greg Rosoff OP  @Reply  
     
4 years ago
The modification would be to take the record set, generate the emails to the terminated users (to verify they no longer have a business need for access to a universe of financial systems), and then record/log the date/time the email was produced.
Greg Rosoff OP  @Reply  
     
4 years ago
Private Sub cmd_SendUserTerminatedEmail_Click()

    Dim db As Database
    Dim rs As Recordset
    Dim Msg As String, Subject As String, Terminated_Log_Number As String, Research_Initiated As String
    Dim strSQL As String
    Dim Counter As Long
    Dim Research_Initiated_Date As Date
    
    If MsgBox("Are you sure?", vbYesNoCancel) <> vbYes Then Exit Sub
    
    Set db = CurrentDb
    Set rs = db.OpenRecordset("Select * From tbl_Terminated_System_Users_Log WHERE tbl_Terminated_Temp_As_Of_Period=#" & Format(Me.cmb_Date2, "yyyy-mm-dd") & "# AND Research_Initiated = No")
    
    'DoCmd.RunSQL "INSERT INTO tbl_Terminated_System_Users_Log (Research_Initiated_Date) VALUES (Date())"
    'Date() AS Research_Initiated_Date INTO tbl_Terminated_System_Users_Log
    
    Counter = 0
  
   While Not rs.EOF
    
        Msg = "Dear " & rs!tbl_System_Users_Full_Name & ",<p>" & _
            "Navy Medicine, in partnership with the Navy and DHA, is conducting user access reviews across our financial systems. You've been identified in DMHRSi as no longer requiring" & _
            " access to " & rs!System_Name & " for Navy Medicine as of " & rs!tbl_Terminated_Temp_As_Of_Period & ".<P>" & _
            "BUMED is notifying the Service Provider that your account is to be locked, terminated, or deactivated depending on " & rs!System_Name & "'s functions." & _
            " Please contact us at [email protected] if you dispute this or have any questions. We will immediately refer any catagorization issues to DMDC." & "<br><br>" & _
            "Regards" & ",<br><br>" & _
            "BUMED FISCAM Team"
        Subject = "System User Termination -" & rs!System_Name & "-" & "Terminated-" & rs!Terminated_Log_Number & "-" & Now()

        SendTerminatedEmail Msg, rs!Updated_Email, Subject, True
        Counter = Counter + 1
            
        rs.MoveNext
    Wend
    MsgBox "Done! Sent " & Counter & " emails."
    
    
    
    'WHERE DateTimeValue >= #" & Format(aDateTimeVariable, "yyyy-mm-dd hh:nn:ss") & "#;"
    'DQRY = "Update " & tb & " Set ImportDate =  date() "
    
    'UPDATE tbl_Terminated_System_Users_Log SET tbl_Terminated_System_Users_Log.Research_Initiated_Date = #11/14/2022#
     'WHERE (((tbl_Terminated_System_Users_Log.Research_Initiated)=No) AND ((tbl_Terminated_System_Users_Log.tbl_Terminated_Temp_Date_Pulled)=#10/31/2022#));

   'WHERE (((tbl_DMHRSi_Temp.Date_Pulled)=[Forms]![frm_Start]![cmb_Date1]));
        
    'db.Execute "UPDATE tbl_Terminated_System_Users_Log SET Research_Initiated_Date = Now() " & _
        " WHERE tbl_Terminated_Temp_Date_Pulled= #" & Format(Me.cmb_Date2, "yyyy-mm-dd") & "#" & _
        " AND Research_Initiated = No;"
    
    'db.Execute "UPDATE tbl_Terminated_System_Users_Log " _
        & "SET Research_Initiated = Yes" _
        & "WHERE tbl_Terminated_Temp_Date_Pulled=#" & Format(Me.cmb_Date2, "yyyy-mm-dd") _
        & "' AND Research_Initiated = No;", dbFailOnError
    
      
    Set rs = Nothing
    Set db = Nothing
      
    
    
End Sub
Juan C Rivera  @Reply  
            
4 years ago
Data Macros
I just did this I added a check box yes / no on sent mail = yes, add a field DatenTimeSentEmail make check box yes on change data macro at table level to update the field DatenTimeSentEmail =Now()
watch the video and let me know if this helped.  This is a rough explanation but the concept is the same, on change...you should be able to update the field at table level.
Greg Rosoff OP  @Reply  
     
4 years ago
I looked at the data macros and Advanced #6 and those will work great for the second or third order events.  I'm still struggling with the first order event.  If I understand your suggestion above, you're proposing that I use a check box I manually update and then spring the date off of that?  I'm really wanting to have that automatically performed so that I can point to the function for our auditors to reduce their concerns of chicanery on my part.  Also, I didn't see a tip jar for you!!
Juan C Rivera  @Reply  
            
4 years ago
set off the checkbox on a button before you fire off the cmd.
private sub buttonGO()
check box = true
cmd_SendUserTerminatedEmail_Click()
end sub

this may work

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Send Email.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/13/2026 3:07:04 AM. PLT: 1s