Sign Up |  Live StatsLive Stats    Articles 35,345| Comments 159,791| Members 17,821, Newest cdotkhn| Online 221
Home Contact
 (Forgotten?): 
    Sikhism

   
                                                                     Your Banner Here!    

how do I repeat an action every day

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 400 USD, Received: 35 USD (9%)
Please Donate...
Related Topics...
Thread Thread Starter Forum Replies Last Post
Hunza Lake: History may repeat itself Narayanjot Kaur Nature 0 25-May-2010 10:37 AM
How to Repeat Text in Multiple Record Fields? Larry Bohen Information Technology 3 28-Jul-2006 08:36 AM
repeat mails JacquieCC Information Technology 1 28-Jul-2006 08:17 AM
Entering repeat data in MS Office Jay Information Technology 1 28-Jul-2006 08:15 AM
Is it appropriate to analyse our ancestors ! so as to not repeat there mistakes ? hps62 Interfaith Dialogues 1 25-Jul-2006 03:28 AM


Tags
repeat, action, every, day
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 11-Nov-2005, 20:09 PM
mike's Avatar mike
Guest
 
Posts: n/a
   
   
how do I repeat an action every day

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
I export information via email every day to various customers (when I
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/7141-how-do-i-repeat-action-every.html
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7141
remember!) I use a macro to send the results of a query output as an excel
spreadsheet and it works fine but I forget to do it I need to automate the
macro to run say every 24 hours and then to OK the "do you want to send"
question I get

*








 
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-Nov-2005, 20:09 PM
Ron Hinds's Avatar Ron Hinds
Guest
 
Posts: n/a
   
   
Re: how do I repeat an action every day

I've solved a similar problem by using the Windows Task Scheduler to start
my Access app with a command-line switch (/cmd auto). Then, in the Open
event of my main form, I check for the "auto" switch like so:

If Command = "auto" Then
....
End If

At this point I set a global variable of type Boolean to True and then run
the code. In the code to be run, I check the global each time I might be
showing a user prompt, etc. and skip the prompt if it is True. After the
code is run, I exit the Access application. It works like a champ so far (>
6 months) at nearly 500 installations in the field!

"mike" wrote in message
news:F57F2EFF-2D5B-4158-95E3-8297E0AA0813@microsoft.com...
> I export information via email every day to various customers (when I
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7141
> remember!) I use a macro to send the results of a query output as an excel
> spreadsheet and it works fine but I forget to do it I need to automate the
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7141
> macro to run say every 24 hours and then to OK the "do you want to send"
> question I get



Reply With Quote
  #3 (permalink)  
Old 11-Nov-2005, 20:09 PM
mike's Avatar mike
Guest
 
Posts: n/a
   
   
Re: how do I repeat an action every day

Thanks for your help, I don't think I'm clever enough to understand it
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7141
perhaps its going to be too complicated for me
Mike

"Ron Hinds" wrote:

> I've solved a similar problem by using the Windows Task Scheduler to start
> my Access app with a command-line switch (/cmd auto). Then, in the Open
> event of my main form, I check for the "auto" switch like so:
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7141
>
> If Command = "auto" Then
> ....
> End If
>
> At this point I set a global variable of type Boolean to True and then run
> the code. In the code to be run, I check the global each time I might be
> showing a user prompt, etc. and skip the prompt if it is True. After the
> code is run, I exit the Access application. It works like a champ so far (>
> 6 months) at nearly 500 installations in the field!
>
> "mike" wrote in message
> news:F57F2EFF-2D5B-4158-95E3-8297E0AA0813@microsoft.com...
> > I export information via email every day to various customers (when I
> > remember!) I use a macro to send the results of a query output as an excel
> > spreadsheet and it works fine but I forget to do it I need to automate the
> > macro to run say every 24 hours and then to OK the "do you want to send"
> > question I get

>
>
>

Reply With Quote
  #4 (permalink)  
Old 12-Nov-2005, 22:39 PM
mike's Avatar mike
Guest
 
Posts: n/a
   
   
Re: how do I repeat an action every day

Its mike again, I think you mean I start access via task scheduler at the
time I want to send the email and then find out if access was started
automatically if so send the email and exit the programme - brilliant I'll
try to work out the details but if I have no joy I'll post a help me message
Thanks


"mike" wrote:

> Thanks for your help, I don't think I'm clever enough to understand it
> perhaps its going to be too complicated for me
> Mike
>
> "Ron Hinds" wrote:
>
> > I've solved a similar problem by using the Windows Task Scheduler to start
> > my Access app with a command-line switch (/cmd auto). Then, in the Open
> > event of my main form, I check for the "auto" switch like so:
> >
> > If Command = "auto" Then
> > ....
> > End If
> >
> > At this point I set a global variable of type Boolean to True and then run
> > the code. In the code to be run, I check the global each time I might be
> > showing a user prompt, etc. and skip the prompt if it is True. After the
> > code is run, I exit the Access application. It works like a champ so far (>
> > 6 months) at nearly 500 installations in the field!
> >
> > "mike" wrote in message
> > news:F57F2EFF-2D5B-4158-95E3-8297E0AA0813@microsoft.com...
> > > I export information via email every day to various customers (when I
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7141
> > > remember!) I use a macro to send the results of a query output as an excel
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7141
> > > spreadsheet and it works fine but I forget to do it I need to automate the
> > > macro to run say every 24 hours and then to OK the "do you want to send"
> > > question I get

> >
> >
> >

Reply With Quote
  #5 (permalink)  
Old 12-Nov-2005, 22:40 PM
Ron Hinds's Avatar Ron Hinds
Guest
 
Posts: n/a
   
   
Re: how do I repeat an action every day

Hi Mike - yes, that's exactly what I mean. In the Task Scheduler command add
"/cmd auto" after the database name. So your command string in Task
Scheduler might look like:

"C:\Program Files\Microsoft Office\Office\msaccess.exe"
"path_and_filename_of_your_mdb_or_mde" /cmd auto

Next, in the Open event of your main form, check for the "auto" command line
switch like so:

If Command = "auto" Then
'Set a global Boolean variable
gboolAutoRun = True
'Now run your macro
DoCmd.RunMacro "your_macro_name"
'Now quit Access
Application.Quit acQuitSaveNone
Else
gboolAutoRun = False
End If

Be sure to modify your macro so that it skips any dialog boxes or any other
code that might require user intervention if gboolAutoRun is True, since no
one will be there to clik "OK" or whatever! For instance, I cange all of my
error handlers to write to a log file instead of displaying a message box.
Here is the LogError routine:

Public Sub LogError(ModName As String, Number As Long, Desc As String,
Optional FileName As String)
'Log error number, description, and module/routine that generated the error
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7141
'to a text file, optionally with filename that caused error
On Error Resume Next 'Can't popup a MsgBox because this is
auto-execute

Dim strDateTime As String
Dim strLogDir As String
Dim strLogFile As String
Dim iFileNo As Integer

'Create the log directory if it doesn't exist
strLogDir = "C:\Logs"
If Dir(strLogDir, vbDirectory) = "" Then MkDir strLogDir

'Create new log filename every day
strLogFile = strLogDir & "\Log" & Format(Now(), "mmddyy") & ".txt"
strDateTime = Format(Now(), "mm-dd-yy hh:mm:ss")
iFileNo = FreeFile

Open strLogFile For Append Access Write Lock Write As #iFileNo

If Len(FileName) > 0 Then
Print #iFileNo, strDateTime; Spc(4); ModName; Spc(4); "Error " &
Number; _
Spc(4); Desc; Spc(4); FileName
Else
Print #iFileNo, strDateTime; Spc(4); ModName; Spc(4); "Error " &
Number; _
Spc(4); Desc
End If

Close #iFileNo

End Sub

"mike" wrote in message
news:A0ED834E-3678-4524-8F04-8289DBEDA2B2@microsoft.com...
> Its mike again, I think you mean I start access via task scheduler at the
> time I want to send the email and then find out if access was started
> automatically if so send the email and exit the programme - brilliant I'll
> try to work out the details but if I have no joy I'll post a help me

message
> Thanks
>
>
> "mike" wrote:
>
> > Thanks for your help, I don't think I'm clever enough to understand it
> > perhaps its going to be too complicated for me
> > Mike
> >
> > "Ron Hinds" wrote:
> >
> > > I've solved a similar problem by using the Windows Task Scheduler to

start
> > > my Access app with a command-line switch (/cmd auto). Then, in the

Open
> > > event of my main form, I check for the "auto" switch like so:
> > >
> > > If Command = "auto" Then
> > > ....
> > > End If
> > >
> > > At this point I set a global variable of type Boolean to True and then

run
> > > the code. In the code to be run, I check the global each time I might

be
> > > showing a user prompt, etc. and skip the prompt if it is True. After

the
> > > code is run, I exit the Access application. It works like a champ so

Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7141
far (>
> > > 6 months) at nearly 500 installations in the field!
> > >
> > > "mike" wrote in message
> > > news:F57F2EFF-2D5B-4158-95E3-8297E0AA0813@microsoft.com...
> > > > I export information via email every day to various customers (when

I
> > > > remember!) I use a macro to send the results of a query output as an

excel
> > > > spreadsheet and it works fine but I forget to do it I need to

automate the
> > > > macro to run say every 24 hours and then to OK the "do you want to

send"
> > > > question I get
> > >
> > >
> > >



Reply With Quote
  #6 (permalink)  
Old 12-Nov-2005, 22:40 PM
mike's Avatar mike
Guest
 
Posts: n/a
   
   
Re: how do I repeat an action every day

  Donate Today!  
High Ron
Thanks very much that's brilliant and very nicely explained I really
appreciate your help
Mike

"Ron Hinds" wrote:

> Hi Mike - yes, that's exactly what I mean. In the Task Scheduler command add
> "/cmd auto" after the database name. So your command string in Task
> Scheduler might look like:
>
> "C:\Program Files\Microsoft Office\Office\msaccess.exe"
> "path_and_filename_of_your_mdb_or_mde" /cmd auto
>
> Next, in the Open event of your main form, check for the "auto" command line
> switch like so:
>
> If Command = "auto" Then
> 'Set a global Boolean variable
> gboolAutoRun = True
> 'Now run your macro
> DoCmd.RunMacro "your_macro_name"
> 'Now quit Access
> Application.Quit acQuitSaveNone
> Else
> gboolAutoRun = False
> End If
>
> Be sure to modify your macro so that it skips any dialog boxes or any other
> code that might require user intervention if gboolAutoRun is True, since no
> one will be there to clik "OK" or whatever! For instance, I cange all of my
> error handlers to write to a log file instead of displaying a message box.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7141
> Here is the LogError routine:
>
> Public Sub LogError(ModName As String, Number As Long, Desc As String,
> Optional FileName As String)
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7141
> 'Log error number, description, and module/routine that generated the error
> 'to a text file, optionally with filename that caused error
> On Error Resume Next 'Can't popup a MsgBox because this is
> auto-execute
>
> Dim strDateTime As String
> Dim strLogDir As String
> Dim strLogFile As String
> Dim iFileNo As Integer
>
> 'Create the log directory if it doesn't exist
> strLogDir = "C:\Logs"
> If Dir(strLogDir, vbDirectory) = "" Then MkDir strLogDir
>
> 'Create new log filename every day
> strLogFile = strLogDir & "\Log" & Format(Now(), "mmddyy") & ".txt"
> strDateTime = Format(Now(), "mm-dd-yy hh:mm:ss")
> iFileNo = FreeFile
>
> Open strLogFile For Append Access Write Lock Write As #iFileNo
>
> If Len(FileName) > 0 Then
> Print #iFileNo, strDateTime; Spc(4); ModName; Spc(4); "Error " &
> Number; _
> Spc(4); Desc; Spc(4); FileName
> Else
> Print #iFileNo, strDateTime; Spc(4); ModName; Spc(4); "Error " &
> Number; _
> Spc(4); Desc
> End If
>
> Close #iFileNo
>
> End Sub
>
> "mike" wrote in message
> news:A0ED834E-3678-4524-8F04-8289DBEDA2B2@microsoft.com...
> > Its mike again, I think you mean I start access via task scheduler at the
> > time I want to send the email and then find out if access was started
> > automatically if so send the email and exit the programme - brilliant I'll
> > try to work out the details but if I have no joy I'll post a help me

> message
> > Thanks
> >
> >
> > "mike" wrote:
> >
> > > Thanks for your help, I don't think I'm clever enough to understand it
> > > perhaps its going to be too complicated for me
> > > Mike
> > >
> > > "Ron Hinds" wrote:
> > >
> > > > I've solved a similar problem by using the Windows Task Scheduler to

> start
> > > > my Access app with a command-line switch (/cmd auto). Then, in the

> Open
> > > > event of my main form, I check for the "auto" switch like so:
> > > >
> > > > If Command = "auto" Then
> > > > ....
> > > > End If
> > > >
> > > > At this point I set a global variable of type Boolean to True and then

> run
> > > > the code. In the code to be run, I check the global each time I might

> be
> > > > showing a user prompt, etc. and skip the prompt if it is True. After

> the
> > > > code is run, I exit the Access application. It works like a champ so

> far (>
> > > > 6 months) at nearly 500 installations in the field!
> > > >
> > > > "mike" wrote in message
> > > > news:F57F2EFF-2D5B-4158-95E3-8297E0AA0813@microsoft.com...
> > > > > I export information via email every day to various customers (when

> I
> > > > > remember!) I use a macro to send the results of a query output as an

> excel
> > > > > spreadsheet and it works fine but I forget to do it I need to

> automate the
> > > > > macro to run say every 24 hours and then to OK the "do you want to

> send"
> > > > > question I get
> > > >
> > > >
> > > >

>
>
>

Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Gurbani Jukebox
Listen to Gurbani while surfing SPN!
» Active Discussions
sikhism need urgent advice.......
Today 10:03 AM
7 Replies, 87 Views
sikhism Who is "Mohan"?
Today 08:46 AM
22 Replies, 348 Views
sikhism How important is Matha...
Today 08:12 AM
59 Replies, 1,041 Views
sikhism ਨਾਮਾ
Today 06:37 AM
2 Replies, 53 Views
sikhism Sikh Diamonds Video...
Today 04:23 AM
6 Replies, 120 Views
sikhism Are Creator and Creation...
Today 01:30 AM
44 Replies, 2,837 Views
sikhism Herman Hesse,...
Today 00:54 AM
13 Replies, 230 Views
sikhism On a Scale of Most...
Yesterday 21:42 PM
30 Replies, 1,277 Views
sikhism I became victim by...
Yesterday 19:50 PM
0 Replies, 46 Views
sikhism Sikh Books downloads
Yesterday 15:39 PM
2 Replies, 66 Views
sikhism Salok Sheikh Farid ji...
Yesterday 09:35 AM
0 Replies, 47 Views
sikhism In Punjab, three farmers...
Yesterday 05:36 AM
0 Replies, 49 Views
sikhism Supernatural Sikhs, what...
Yesterday 03:45 AM
19 Replies, 416 Views
sikhism Sukhmani Sahib Astpadi...
26-May-2012 22:57 PM
0 Replies, 51 Views
Do You Think You Are...
26-May-2012 09:59 AM
94 Replies, 8,258 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.2

All times are GMT +6.5. The time now is 10:37 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.71379 seconds with 30 queries