Results 1 to 4 of 4
  1. #1
    Humreid is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Mar 2020
    Posts
    4

    How to trigger a command button after a period of time


    Hello everyone please I need any VBA code or Macros that can trigger a command button every Friday, that permits the user only to click on it every Friday to perform a calculation that summed all the "yes" in a yes/no data type. The button should only be active on Fridays.

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    So if it doesn't get clicked on a Friday (say it's a holiday for instance) then what? Not until next Friday?
    I think you are asking for 2 different things as well - click automatically every Friday (if that's what "trigger" means), as well as just make the button enabled so that someone can click it. Even if it has already been done automatically?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Humreid is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Mar 2020
    Posts
    4
    What I actually mean is automatically enabling it on Fridays. If it is not Friday, it won't be clickable, it would be grayed out. But when it is Friday, it will get enabled automatically, and a user can use it to sum the value of what he/she has done so far since Monday.

  4. #4
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Assuming your computer calendar settings have weeks commencing on Sundays, then Sunday is weekday=1 and Friday is weekday =6.
    So your code could be

    Code:
    If Weekday(Date)=6 Then Me.YourButtonName.Enabled=True
    The button needs to be disabled by default.

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

Similar Threads

  1. Replies: 2
    Last Post: 09-05-2016, 07:23 AM
  2. Replies: 2
    Last Post: 07-25-2016, 09:42 AM
  3. Replies: 2
    Last Post: 07-24-2012, 12:44 PM
  4. Replies: 1
    Last Post: 07-27-2010, 02:27 PM
  5. Command button for time & date
    By joet5402 in forum Forms
    Replies: 2
    Last Post: 12-20-2007, 02:59 AM

Tags for this Thread

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