Results 1 to 3 of 3
  1. #1
    itm is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    69

    Question Trying to find away to go into a block of code only once

    Hi,



    I have code that I only want to do on the first of every month once. I have it is set that if the day of the month is the first, go into this code, when they they load the form; and it works great. The problem is they may load this for numerus times on that day, and they may even close the Access application and reopen it on tha t day; causing it to run the code again. Is there away that I can just have it run once no matters what on the first of the month?

    Thank you
    itm

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Not sure if this is the best way to do this, but you could have a little table that has just one field - that stores either 'Done' or 'Not Done' - [or just 'True' or 'False'].
    When the form Loads:
    1. Check if it is the 1st of the month.
    2. If it IS the 1st - Check that field in the Table to see if the value in there is True or False.
    3. If it is False - Run your code - and then set the Value to True.
    4. If it is NOT the 1st of the month- Check the field in the Table and if the value is True - set it to False so that the next time the 1st of the month comes around, your code will fire again.
    Hope this helps - or at least gives you some ideas!

  3. #3
    itm is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    69
    Thanks that sounds like it would do it.
    itm

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 01-17-2012, 02:43 PM
  2. Replies: 2
    Last Post: 01-12-2012, 03:34 AM
  3. Find primary key name by code
    By MichaelS in forum Access
    Replies: 2
    Last Post: 09-22-2011, 07:09 AM
  4. Replies: 0
    Last Post: 08-10-2011, 11:59 AM
  5. Flag A Data Block
    By JohnBoy in forum Programming
    Replies: 7
    Last Post: 06-29-2010, 01:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums