Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"Because of this forum, I continue to WOW! my clients!"

Geography

Where in the world do Tek-Tips members come from?

How to handle email attachments sent out overnight when the PC is locked

Pack10 (Programmer)
18 Jun 12 16:34
I have a nightly process which creates a report and emails it to the user.
When I arrive in the office in the morning, I login to my PC (locks up after 10 or so minutes of inactivity) the query runs and the email goes out to the user. Like i mentioned, I suspect this is because of the system security that the machine is locked when inactive. Am i doing something wrong or is this the way it is....when I am on vacation, I don't want to have to login each day to run the job.
BoulderRidge (Programmer)
8 Jul 12 17:23
Hi Pack10,

I don't see any replies but I'm wondering if you've figured out anything more about this scenario. I have an Access app that runs a timer event and am trying to figure out what happens when the user goes to lunch and leaves it running and their computer locks up after 10 minutes--does the app keep running the timer every minute or does it 'go to sleep' or something else?

thanks,

-- BoulderRidge happy shades

SkipVought (Programmer)
8 Jul 12 17:47
Hi,

How is the procedure scheduled?

Are you security settings an issue?

I assume your process requires no user intervention.

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

BoulderRidge (Programmer)
8 Jul 12 18:01
Hi SkipVought,

In my case, every form has a TimerInterval of 60000 and an On Timer event procedure that looks like this:

CODE --> VBA

Private Sub Form_Timer()
On Error GoTo ErrMe
Dim datNow As Date

'Only scheduler should trigger interview updates (else they will trigger multiple times per minute)
If GetUserRole() = gcintRoleScheduler Then
    datNow = Now()
    Call AdvanceMissedInterviews(datNow)
End If

ExitMe:

Exit Sub

ErrMe:
Call ShowError(Err.Number, Err.Description, "Form_Timer")
Resume ExitMe

End Sub 

All it requires is for the user with the internal role of Scheduler to have their copy of the app open (role is assigned on launch and saved in a table local to the local front-end app). The AdvanceMissedInterviews call updates schedule data in the backend database which lives on a network share; the updates are done via linked tables (standard backend tables linked to frontend app). No user action is required to trigger this event.

I can't speak well to the security settings but here's what I know: the frontend app is put in a Trusted Location on the user's local laptop or tablet. The timer event is updating the data properly in general. However we get occasional reports of inconsistent behavior (another user isn't seeing updated results immediately, user claims value they entered was 'changed' by the system to a different value) so I'm trying to figure out precisely what environmental factors might be in play here. I'm not a network admin and can't seem to get anyone at this work site to help answer questions so far (they avoid Access stuff like the plague).

Thanks for your reply,

-- BoulderRidge happy shades

Pack10 (Programmer)
9 Jul 12 10:57
I found a utility named Click Yes which does what I need.
Thanks for your response.
SkipVought (Programmer)
9 Jul 12 11:00
HOW does this solve your problem?

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Pack10 (Programmer)
9 Jul 12 11:03
Outlook hangs waiting for a response. Click yes, is a system utility that simulates clicking the yes button on an email. Our PC's lock up after 10 minutes, so when i get to the office in the morning, the email has already gone out with the job, otherwise it would be waiting for me when i get in.
SkipVought (Programmer)
9 Jul 12 11:09


AVOID using Outlook for remote procedures!!!

Remote CLICK is an awful solution!

Use the CDO object instead.

I have an Excel procedure that runs @ 4:00, 14:00 and 21:00 7 days a week, 365 days per year and sends mail notices via CDO with each run.

CODE

Public Function CdoSend( _
    MailTo As String, _
    MailFrom As String, _
    Subject As String, _
    MessageText As String, _
    Optional CC As String, _
    Optional BCC As String, _
    Optional FileAttachment As String) As Boolean
On Error GoTo CdoSend_Err

' This example use late binding, you don't have to set a reference
' You must be online when you run the sub
    Dim oMsg As Object
    Dim oConf As Object
    Dim Flds As Variant
 
    Set oMsg = CreateObject("CDO.Message")
    Set oConf = CreateObject("CDO.Configuration")
 
        oConf.Load -1    ' CDO Source Defaults
        Set Flds = oConf.Fields
        With Flds
            .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "YourMailServer.com"
            .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
            .Update
        End With
 
    With oMsg
        Set .Configuration = oConf
        
        .To = MailTo
        .CC = CC
        .BCC = BCC
        .FROM = MailFrom
        
        .Subject = Subject
        .TextBody = MessageText

        
        If Len(FileAttachment & "") > 0 Then
            
            '## Last make sure the file actually exists and send it!:
            Dim fso
            Set fso = CreateObject("Scripting.FileSystemObject")
            If fso.FileExists(FileAttachment) Then
                .AddAttachment FileAttachment
            Else
                'otherwise return that the send failed and exit function:
                Debug.Print "[CdoSend.Error]=> File attachment path does not exist, quitting..."
                CdoSend = False
                Exit Function
            End If
        
        End If
    
        '## Send zee message! ##
        .sEnd
    
    End With

    Set fso = Nothing
    Set oMsg = Nothing
    Set oConf = Nothing
    
    CdoSend = True

CdoSend_Exit:
    Exit Function
    
CdoSend_Err:
    Debug.Print "[CdoSend.Error(" & Err.Number & ")]=> " & Err.Description
    CdoSend = False
    Resume CdoSend_Exit
End Function 

Skip,

glassesJust traded in my old subtlety...
for a NUANCE!tongue

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close