Re: OutputTo: Path Name Using [Forms]!

From: Steve Schapel (schapel_at_mvps.org.ns)
Date: 03/19/05


Date: Sat, 19 Mar 2005 20:42:35 +1300

AZ,

Well, do you or don't you have a form named 1199563? Does this form
have a control on it with yesterday's date on it? What are the other
actions in your macro? Where (i.e. what event) is the macro called
from? If you have such a form, and if the form is open at the time that
the macro is run, and if the macro is not being triggered from an event
on the form, then your syntax is correct.

-- 
Steve Schapel, Microsoft Access MVP
AZ Analog wrote:
> Good day!
> I need to run 43 queries each day, which has traditionally been performed 
> manually.  I'm working on autonomating the process.  Here is what needs to 
> happen:
> 1. A query is run, which asks for a date to use as a condition for the query.
> 2. The query is exported to the C:\drive.
> 3.  Due to documentation procedures, I need to place the date (the same date 
> which the query was run by.) into the filename.  Unfortunately, the date that 
> needs to be in the filename is not the same date that the query is actually 
> run. Thus, the filename should look like 3-15-05 1199563.xls when the query 
> is run on 3-16-05. etc etc.
>  
> I'm trying to use OutputTo with the following output path:
> ="C:\" & [Forms]![1199563]![PROCESSDAT] & " 1199563.xls"
> What I'm trying to do is harness the date from the query, and use it as part 
> of the filename.  However, I get errors with using this expression as the 
> output filename.  The first error I got stated that Access couldn't find a 
> form named 1199563.  In an attempt to fix this error, I created a form, and 
> tried to OutputTo that form using the same method.  Subsequently, I received 
> another error stating in effect that Access couldn't find the form 1199563 
> because the form may not be open.  Ok...so I added a macro command previous 
> to the OutputTo command in order to open the form 1199563.  Then I receive 
> another error stating that the form could not be exported because it is 
> already in use.  LOL.
> 
> Would anyone mind helping me with the proper syntax for using a query 
> condition within the outputto filename?  Thanks a million for your help! 


Relevant Pages

  • Re: OutputTo: Path Name Using [Forms]!
    ... date by which the query is run. ... The macro isn't called from anything yet, ... it's 43 lines of OutputTo. ... into the outputTo filename. ...
    (microsoft.public.access.macros)
  • OutputTo: Path Name Using [Forms]!
    ... A query is run, which asks for a date to use as a condition for the query. ... needs to be in the filename is not the same date that the query is actually ... I'm trying to use OutputTo with the following output path: ... Ok...so I added a macro command previous ...
    (microsoft.public.access.macros)
  • Re: Open Query Action - Browse for query name in current DB
    ... Then typed this as the object name in the Open Query action within the Macro. ... but ratther to OutputTo a file. ...
    (microsoft.public.access.queries)
  • transfer spreadsheet
    ... When running the docmd outputto or transferspreadsheet statements from within ... The query is a straight query no grouping, sorting, ... But when trying to do this from a macro or module ...
    (microsoft.public.access.modulesdaovba)
  • Re: OutputTo: Path Name Using [Forms]!
    ... You are opening the 1199563 form via th macro, ... the Object Type argument to be Query, and the Object Name to be the name ... it's 43 lines of OutputTo. ... > and exports to excel. ...
    (microsoft.public.access.macros)