G
Guest
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!
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!