Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8984765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:11:09+00:00 2026-06-15T21:11:09+00:00

I have been trying to pull this off and maybe I am getting close.

  • 0

I have been trying to pull this off and maybe I am getting close.
I have some code in Access I need to Run at a specific time of day. I do not want to use Windows Task Scheduler.

So I have this function:

Public Function RunProgram()
Dim RunDateFormat As String

RunDateFormat = Format(Now(), "HH:MM:SS")
    If RunDateFormat = ("15:30:00") Then

'Call these codes and other stuff in here

End If

Then I create a Macro called Macro1 to call the function, the form On Timer calls
the Macro as indicated below.

enter image description here

The problem is if I set the interval to; example: 1000, I get an email every second and the program keeps running.

Please help: I need to set this so the code runs at the exact time but only one time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:11:11+00:00Added an answer on June 15, 2026 at 9:11 pm

    How about you use a static date variable:

    static dateRan as date
    if dateRan = Date then exit Function
    If RunDateFormat = ("15:30:00") Then
    dateRan = date
    'Call these codes and other stuff in here
    End If
    

    This way you could keep it running overnight and it will work the next day assuming no error occurs to halt operation.

    As I’m sure you’re aware, doing a scheduled task through Access requires the form to be up and running so you have a fairly large opportunity to fail to run the your time sensitive task. I really do recommend using the task scheduler if it is feasible.

    As hinted at by HelloW, I wouldn’t go with every second for checking unless it is critical that the code run about the right time. If it is critical, you may want to do some checks and modify the timerinterval programmatically.

    Like so:

    If Hour(Now) < 14 or Hour(Now) >= 16 then
        me.TimerInterval = 3600000
    else
        me.TimerInterval = 30000
    end if
    

    You could narrow it down more, to where you have the checks run more often the closer you get to the time you need to run your time sensitive code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am starting to pull my hair out over this! I have been trying
I have been trying to pull some information from a MSSQL database and deposit
I have been trying to use the document.getElementByID to pull information from an HTML
I have been trying to setup git for our web development team unsuccessfully. Some
I have been trying to figure this out for several hours but have had
I have been trying to run a mySQL query that populates a HTML form
I have been trying to pull all infomation where $user is equal to subscriberID
So I've been trying to figure out the most efficient way to pull off
I have been trying to learn php and have been getting better day by
I have been trying to follow the instructions in the answer to this question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.