Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

Completely Stumped - Need Help w/macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff C - 30 May 2007 14:18 GMT
I have been reworking macros for the past 5 days and nothing is working the
way it is supposed to.

Access 2003

The macros I created work fine if the database is open and I just run them.

I am trying to run the macros from the command prompt.

I have created a shortcut,

Start in: c:\Program Files\Microsoft Office\Office11

Target:

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
"s:\Directory\Analysis.mdb" /x "PrintReport"

No matter what I do, compile the database, compact and repair etc.

in the middle of the macro a window opens "This action will reset the
current code in break mode"

Clicking no the macro processes run but then the database freezes and I have
to end program with task manager.

Any suggestions would be more than welcome, thank you.

Signature

Jeff C
Live Well .. Be Happy In All You Do

Wayne-I-M - 30 May 2007 14:31 GMT
Hi Jeff.

Try this

"""C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE""
""s:\Directory\Analysis.mdb""/XPrintReport", 1

Signature

Wayne
Manchester, England.

> I have been reworking macros for the past 5 days and nothing is working the
> way it is supposed to.
[quoted text clipped - 23 lines]
>
> Any suggestions would be more than welcome, thank you.
Jeff C - 30 May 2007 14:44 GMT
Using your example gave me error that the "C:\...." Path could not be found,
I then received an error stating the the switch being used (,1)? was not
valid in Access.

Thank you though I am still stumped
Signature

Jeff C
Live Well .. Be Happy In All You Do

> Hi Jeff.
>
[quoted text clipped - 30 lines]
> >
> > Any suggestions would be more than welcome, thank you.
Wayne-I-M - 30 May 2007 14:40 GMT
Just had a thought.  Why not create a autoexec macro in your DB that will run
OnOpen of the DB.  Use the windows shortcut to open the DB and this will
start off the macro.  Much simpler.

Signature

Wayne
Manchester, England.

> I have been reworking macros for the past 5 days and nothing is working the
> way it is supposed to.
[quoted text clipped - 23 lines]
>
> Any suggestions would be more than welcome, thank you.
Jeff C - 30 May 2007 14:47 GMT
The database is used by many others, I have code that runs on startup
starting customed forms depending on the user, I have programmed the database
to just open without anything running based on my user ID though.
Signature

Jeff C
Live Well .. Be Happy In All You Do

> Just had a thought.  Why not create a autoexec macro in your DB that will run
> OnOpen of the DB.  Use the windows shortcut to open the DB and this will
[quoted text clipped - 27 lines]
> >
> > Any suggestions would be more than welcome, thank you.
Wayne-I-M - 30 May 2007 15:12 GMT
"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"  
"s:\Directory\Analysis.mdb" /x "PrintReport"

This all goes on 1 line.  Note the spaces between the " " and no space
between /x (not sure if this makes a difference but best leave it as it is)

I just created a small DB (on our S drive) and tested this from a shortcut
(on my C drive) on the the desktop - works fine for me.

Signature

Wayne
Manchester, England.

> The database is used by many others, I have code that runs on startup
> starting customed forms depending on the user, I have programmed the database
[quoted text clipped - 31 lines]
> > >
> > > Any suggestions would be more than welcome, thank you.
Jeff C - 30 May 2007 16:14 GMT
Wayne, thank you for your help but I am now back to the same original error.  
What could be causing it?  How to resolve?
Signature

Jeff C
Live Well .. Be Happy In All You Do

> "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"  
> "s:\Directory\Analysis.mdb" /x "PrintReport"
[quoted text clipped - 40 lines]
> > > >
> > > > Any suggestions would be more than welcome, thank you.
Wayne-I-M - 30 May 2007 20:28 GMT
Hi

There are a few things you can try

Open the macro in design and click Run (at the top of the screen).

Re-write a simple macro (open a form or something else simple).  Set your
shortcut to run this macro - do you have the same problem - it not then just
rewrite the main macro completely.

If there are a number of sections to the macro - set throught it.

Etc.
Signature

Wayne
Manchester, England.

> Wayne, thank you for your help but I am now back to the same original error.  
> What could be causing it?  How to resolve?
[quoted text clipped - 43 lines]
> > > > >
> > > > > Any suggestions would be more than welcome, thank you.
Jeff C - 30 May 2007 21:28 GMT
Macro:
SetWarnings Off
Openreport
SetWarnings On
Quit

Runs fine from the program, runs fine when in design mode and clicking run

When placed in command line I get the error and the program freezes.

Help
Signature

Jeff C
Live Well .. Be Happy In All You Do

> Hi
>
[quoted text clipped - 57 lines]
> > > > > >
> > > > > > Any suggestions would be more than welcome, thank you.
lj - 29 May 2007 04:01 GMT
"Jeff C" <JeffC@discussions.microsoft.com> дÈëÏûÏ¢ÐÂÎÅ:DF6C78C3-9E3A-45A8-8415-84CB0F60C2A0@microsoft.com...
> Macro:
> SetWarnings Off
[quoted text clipped - 83 lines]
>> > > > > >
>> > > > > > Any suggestions would be more than welcome, thank you.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.