Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Emmanuel is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2020
    Posts
    272
    Quote Originally Posted by isladogs View Post
    Run as Administrator is an option when you right click on various programs. Most of the time it isn't needed in Access. However, it provides elevated permissions to do things using VBA like editing the HKLM hive of the registry, change the system date/time etc.



    Try running the ChangeClockDate or ChangeClockTime procedures (or do both together using ChangeSystemClockDateTime) using the updated file I've attached here.

    First of all try to do so with Access opened normally. You will get error 70 - permission denied.
    Repeat with Access using Run As Administrator. Those procedures will then work. Use ResetSystemClockDateTime to reverse the changes
    let me have a look at you db and get back to you

  2. #17
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,265
    OK, I just ran the change and reset, no issues?
    I actually tested the Date and Time in the immediate window yesterday, and I use the Access icon on the task bar.
    I just checked my MSACCESS.exe and owner is system. I cannot see anything different on the shortcuts on the start menu either.?

    Nice code as well, that should help a few people
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #18
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,127
    Forgot to mention this previously.
    More recent versions such as A365 include Run As Administrator as part of the default context menu.

    For earlier versions, there are at least 5 ways of adding the Run As Administrator option

    1 For A2010/2013, hold the shift key down whilst you right click the Access shortcut to add the Run As Administrator option
    For A2007, the same action adds Run As ... to the context menu. Click Administrator and add the password for the Windows Admin account.

    2. Alternatively, you can right click on the MSACCESS.EXE program file itself in Windows File Explorer

    3. Make your own Access desktop shortcut from the program file. It will include Run As ...

    4. Make your own Access desktop shortcut from the program file. Click the Advanced button on the shortcut and tick Run As Administrator

    5. Using Windows 10 (Pro only??), you can use the Access shortcut in the Start menu instead. That includes Run As... under the More section.
    This isn't possible in Windows 7

    IIRC correctly, you can also do this by editing the registry but I can't remember the precise details offhand

    Hope that's of use to some of you....

    EDIT
    Using Run as Administrator with A2010 onwards, the code to change/reset the system clock works perfectly

    However using A2007 on a VM:
    When I tried using the code to change the system date/time as a standard user, the code ran but the system clock didn't change.
    Using Run As Admin, the clock changed...and then changed back almost immediately.
    Last edited by isladogs; 06-28-2021 at 03:45 PM.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 12-05-2019, 04:18 PM
  2. Replies: 11
    Last Post: 12-04-2017, 07:18 AM
  3. Replies: 6
    Last Post: 03-02-2016, 12:58 PM
  4. Replies: 5
    Last Post: 04-11-2015, 03:54 AM
  5. Can System Restore correct Form Size issue
    By fordtough in forum Forms
    Replies: 0
    Last Post: 04-12-2011, 02:56 PM

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