Macro and Command Line Help Please

binesh

New member
Local time
Today, 08:37
Joined
Nov 20, 2007
Messages
2
Hello,

I have a the following command line within an application that runs a MS Access Macro.

"C:\Program Files\Microsoft Office\Office11\msaccess.exe" "\\SERVER\analyst\libraries\UK\UK.mdb" /Excl /X Upload

Upload is the name of the macro. The Macro runs a query.

1. Is there away for the above to not display MS Access or Minimize option in command line above?

2. How do I minimize the database MS Access database within the macro if this is not possible? Ive tried using setobject and then minimize but doesnt seem to work.

Your help will be appreciated.

Thanks
 
Startup Command Line Cheatsheet

I hope this attachment will assist you.

Recommended Order of use for Command-Line Switches
The following is the order to follow when creating command-line switches for Access database shortcuts. All switches are optional.

Document conventions: <> - Place holder for required text.
<<>> - Place holder for optional text.
{} - Supplies additional information about switch, but should not be copied into command-line.

/runtime
/NoStartup
/wrkgrp <system filename>
/User "<username>"
/Pwd "<password>"
/Profile <user profile> <database>
/Excl
/Ro
/Repair
/Compact <<new database>> {Do not use with repair switch}
/X <macro> {Not the recommended method, use "Autoexec" macro instead or startup options. Do not use with compact or repair.}
/Cmd <value> {Must always be last. Do not use with compact or repair.}
 

Attachments

Last edited:
Hi,
Thanks for the reply. I've seen some docs as to the ones attached on the internet but still unsure how any of these commands can work to minimize. Do you have an exmaple of any?
Thanks
 
I do not have any examples to provide but I believe your best option would be to run this in Visual Basic. Info how to set up in start up. From here you can be flexible.

To run a Visual Basic for Applications procedure when you open a database, use the RunCode action in the AutoExec macro or in the macro that you run by using the command-line option /x. You can also run a Visual Basic procedure when you open a database by creating a form with a Visual Basic procedure defined for its OnOpen event. Designate this form as the startup form by right-clicking the Database window, clicking Startup, and then entering that form in the Display Form/Page box.
To specify a forward slash ( / ) or semicolon ( ; ) on the command line, type the character twice. For example, to specify the password ;mjs/md on the command line, type ;;mjs//md following the /pwd command-line option.
 
Access Always opens an MDI window i.e. access itself so all other windows (usually forms) are child windows so when you close access ALL open forms are automatically closed. I have seen some ugly possible workrounds in my time using windows API and setting the Access Splash screen to nothing.
 

Users who are viewing this thread

Back
Top Bottom