Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Software Development
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
Solved: Use Macro (or VBA/Module) To Determine If Runtime Environment Is Being Used

Reply  
Thread Tools
maxx_eclipse's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: May 2007
Location: http://127.0.0.1
Experience: Intermediate In Few Areas
08-Feb-2010, 02:07 AM #1
Solved: Use Macro (or VBA/Module) To Determine If Runtime Environment Is Being Used
Afternoon everyone,

I'm attempting to use an AutoExec code that will execute certain functions when the database opens. However, I know that some people in the Office have the full version of Access, while others need to use the runtime environment to run the database. The problem with using the runtime environment is that the LockNavigationPane event in AutoExec won't execute because the navigation pane does not exist in the runtime environment, which then forces the database to close on a macro error.

I originally tried to use On Error Next in the AutoExec macro, but the runtime environment won't recognise that. So I was wondering if there is some way that I can tell the AutoExec macro to check whether the full Access program or runtime environment is being used, hence determine the code to be used.

So, basically I'm wondering if it's possible for the AutoExec macro to include a piece of code to determine whether the runtime environment is being used or not.

Thank you for your time.
maxx_eclipse's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: May 2007
Location: http://127.0.0.1
Experience: Intermediate In Few Areas
11-Feb-2010, 12:29 AM #2
*bump*

Any ideas as to how to go about this?
maxx_eclipse's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: May 2007
Location: http://127.0.0.1
Experience: Intermediate In Few Areas
12-Feb-2010, 09:54 AM #3
Here's the answer given on the Microsoft Discussion forum:

Discussions In Programming
maxx_eclipse's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: May 2007
Location: http://127.0.0.1
Experience: Intermediate In Few Areas
13-Feb-2010, 03:16 AM #4
THE SOLUTION:

Code:
Function StartUp()

    If SysCmd(acSysCmdRuntime) = True Then
    DoCmd.OpenForm "Task List", acNormal, , , acFormEdit, acWindowNormal
End If
    If SysCmd(acSysCmdRuntime) = False Then
    RunCommand acCmdWindowHide
    DoCmd.OpenForm "Task List", acNormal, , , acFormEdit, acWindowNormal
    DoCmd.LockNavigationPane True
End If

End Function
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:14 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.