Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Naming PDFs during export from crystal

Status
Not open for further replies.

teachmecr

Programmer
Oct 1, 2006
72
US
Hi guys i have the following code in VB access which is working fine for me. It creates a PDF perfectly but i need to use some naming convention for the PDFs. i want to be able to capture the current date and time in VB and use that as part of the name. Im using Now function for that purpose but its not giving me the right results. Any ideas of how i can achieve the following. Names for pdf files should be the account name , then report date and then they current date and time. Thanks u all for u help..

Private Sub cmd_pdf_Click()

stracct = Forms![Mainform]![cbo_ParentAccounts].Value ---account name combo (works)
strenddt = Forms![Mainform]![cbo_reportenddt].Value --doesn't work
strcurdt = Now() --doesn't work

'Exporting to PDF
'Defines report's format type

Me.crxreport.ExportOptions.FormatType = crEFTPortableDocFormat
'Defines report's destination type
Me.crxreport.ExportOptions.DestinationType = crEDTDiskFile
'Defines report's file name
Me.crxreport.ExportOptions.DiskFileName = "\\Myreports\Reports2006\" & stracct + strenddt + strcurdt & ".pdf"
Me.crxreport.Export False
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top