I have a database in Access 97 that records parking lot violations. Within that database is a violations history report that I must occasionally submit to a towing a towing agency that I email in MS Word. I normally save the report as an RTF file and then email it, but I want to automate the process so the clerks can do it.
I created a macro using the "OutputTo" function. When defining the output file, I want the file name to be the license plate number. I define it as follows:
C:\Documents and Settings\AJJC\My Documents\TOWING\[license#].doc
I was assuming that the file would be created using the license plate number as the name, but the file name keeps being saved as [license#].doc
I tried " ([license#]) ", =[license#] and a lot of differnt combinations, but I get the same result.
"License#" is the field name in the underlying query. I have [enter plate number] as the criteria for that field in the query so that when the report is run you are prompted to enter the plate number.
I tried using C:\Documents and Settings\AJJC\My Documents\TOWING\[enter plate number].doc but again I get the same result.
Does anyone know how I can get the macro to automatically generate a file name that corresponds to the plate number I am running the report for.
(I know---I ended my sentence with a preposition)
It can probably be done using VBA, but I am a novice in that area and I want to get this done quickly. Can it be done with a macro?
Would appreciate your help.
JOCAT
I created a macro using the "OutputTo" function. When defining the output file, I want the file name to be the license plate number. I define it as follows:
C:\Documents and Settings\AJJC\My Documents\TOWING\[license#].doc
I was assuming that the file would be created using the license plate number as the name, but the file name keeps being saved as [license#].doc
I tried " ([license#]) ", =[license#] and a lot of differnt combinations, but I get the same result.
"License#" is the field name in the underlying query. I have [enter plate number] as the criteria for that field in the query so that when the report is run you are prompted to enter the plate number.
I tried using C:\Documents and Settings\AJJC\My Documents\TOWING\[enter plate number].doc but again I get the same result.
Does anyone know how I can get the macro to automatically generate a file name that corresponds to the plate number I am running the report for.
(I know---I ended my sentence with a preposition)
It can probably be done using VBA, but I am a novice in that area and I want to get this done quickly. Can it be done with a macro?
Would appreciate your help.
JOCAT