View Full Version : Make snapshots with variable names


bobfin
11-17-2006, 01:51 PM
I'm trying to automate the creation of report snapshot whose name will vary each day. The snapshot name is in a textbox on a form. I have a macro that opens this form (hidden) and then uses OutputTo to make the snapshot. I tried the OutputTo action and got a file whose name was the textbox name. I tried the OutputTo method in a custom function and the computer hung up. Here's the code for the function:

DoCmd.OutputTo acOutputReport, "DailyStats", acFormatSNP, "C:\Stats\[Forms]![frmRptDate]![txtDailyName]", False

The value in txtDailyName is a name like "DailyStats 20061117.snp".

Am I close or should I try a different method?

boblarson
11-17-2006, 02:01 PM
DoCmd.OutputTo acOutputReport, "DailyStats", acFormatSNP, "C:\Stats\" & Forms!frmRptDate.txtDailyName, False

bobfin
11-17-2006, 02:17 PM
Thanks, that syntax worked with the OutputTo method.

sudhirhinduja
03-11-2007, 07:49 PM
Hi, I'm trying the same syntax but it says:
The database engine could not lock tblOrders because it is already in use by another person/process.
The Report is based on a query qryCurrentOrders as the record source and qruCurrentOrders checks for a DummyReport to be checked which is checkd on the FormCurrent event.
Please help.
Thanks,
Sudhir.