VBA Code in Access

DoCmd.OutputTo acReport, "Rpt_employee_Main", "RichTextFormat(*.rtf)", "D:\abc\Report_Employees\" & Format$(Date, "mmddyy") & "_employee_Main.rtf", False, "", 0

The above syntax is taken from MS Access Module, The only thing I can understand in this code is its outputing the report to a given path BUT what does the code mean by "& Format$(Date, "mmddyy") & "_employee_Main.rtf", False, "", 0"
 Please advice
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


It is bulding a filename in the format:


Where 020508 is a formatted date.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It is going to append the current date to the start of the output file name in a

"010208" format
In other words,
Date() is today's Date.

Format$(Date, "mmddyy")  formats  today's date in a mmddyy format. (020508)
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Rey Obrero (Capricorn1)Commented:

Format$(Date, "mmddyy")

is added to the filename   _employee_Main.rtf

to be           020508_employee_Main.rtf

False - not to open the application

look for OutputTo Method in the vba help for more detailed info
"D:\abc\Report_Employees\" & Format$(Date, "mmddyy") & "_employee_Main.rtf" is all one argument being passed to the OutputTo method of DoCMD. It contatenates constant strings, with the date ( which obviously changes each day) with the intention of producing a new filename for the report each day.

 So on the 6th of February 2008 , this section of code means the report will be output to

How quick and how many responses would you like. LOL

Syd2008Author Commented:
what about <<False, " ", 0" >> ?
Is this report checking any IF statement ?
any idea how to use this OutputTo method of DoCMD in SQL ?
The "&" is concating the strings in VB.  So it's prefixing the date in front of the filename.  The rest of the doCmd syntax can be found here:
Rey Obrero (Capricorn1)Commented:
from help

expression.OutputTo(ObjectType, ObjectName, OutputFormat, OutputFile, AutoStart, TemplateFile, Encoding)

AutoStart   Optional Variant. Use True (1) to start the appropriate Microsoft Windowsbased application immediately, with the file specified by the OutputFile    argument loaded. Use False (0) if you don't want to start the application. This argument is ignored for Microsoft Internet Information Server (.htx, .idc) files and Microsoft ActiveX Server (*.asp) files. If you leave this argument blank, the default (False) is assumed.

TemplateFile   Optional Variant. A string expression that's the full name, including the path, of the file you want to use as a template for an HTML (HTML: The standard markup language used for documents on the World Wide Web. HTML uses tags to indicate how Web browsers should display page elements such as text and graphics and how to respond to user actions.), HTX (IDC/HTX files: Microsoft Internet Information Server uses an IDC file and an HTX file to retrieve data from an ODBC data source and format it as an HTML document.), or ASP (Active Server Page (ASP): A file that contains embedded server-side scripting that is executed on a server and sent to and displayed in a client Web browser as a standard HTML file.) file.

Encoding   Optional Variant.

<any idea how to use this OutputTo method of DoCMD in SQL ?>

The OutputTo is a method of the DoCmd object,  SQL is the basis of the object that you want to output, So if you are saying can you output the results of an SQL statement then the answer is yes.

Just create a query with whatever SQL you want and Output the query object instead of the report object.

DoCmd.OutputTo acOutputQuery, "Your query name",....


Syd2008Author Commented:
Thank you everyone
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.