Form

  • Thread starter Thread starter dhoover via AccessMonster.com
  • Start date Start date
D

dhoover via AccessMonster.com

I have a table with 5 fields: ReportName, Export, Print, ExportTo, SaveAs

I'd like to have a form that when a button is clicked, it will look at the
table and if the Export field = true, then export that report using SaveAs as
the name to save the file as and ExportTo as the location to export the
report.

I'm not sure where to start with this...Any help would be much appreciated
 
Will your form be positioned on the record to be exported? Or, do you want to
export some other record in the table? What are you exporting? Do you have
reports with the names in column 'ReportName'?
In the OnClick ebent for your button you will choose 'event procedure' and
then you will have to write some VB code to do the export but without knowing
exactly what you want, I can't provide more details.

-Dorian
 
It will export reports with the names in the ReportName column.


Will your form be positioned on the record to be exported? Or, do you want to
export some other record in the table? What are you exporting? Do you have
reports with the names in column 'ReportName'?
In the OnClick ebent for your button you will choose 'event procedure' and
then you will have to write some VB code to do the export but without knowing
exactly what you want, I can't provide more details.

-Dorian
I have a table with 5 fields: ReportName, Export, Print, ExportTo, SaveAs
[quoted text clipped - 4 lines]
I'm not sure where to start with this...Any help would be much appreciated
 
I actually go the code figured out, but I can't get it to loop through each
record, it only does the first one. I tried sticking DO until .eof and loop
but it only loops through the firt record. This is the code:



On Error GoTo err_exportfile_click

'Exports Month End Reports to G:\NewApp\Month End Reports

Dim strMonth As String
Dim strCFName As String
Dim strFileName As String
Dim strReportname As String
Dim strExportTo As String
Dim blnExport As Boolean


Dim dbs As database
Dim rst As Recordset

Set dbs = CurrentDb

Set rst = dbs.OpenRecordset("month end reports", dbOpenTable)

strMonth = Format([MonthEnding], "mmmyy")
strReportname = Me.ReportName

strCFName = Me!cfname
strFileName = Me!FileName
strExportTo = Me!ExportTo


If Me.Export = True Then

DoCmd.OutputTo acOutputReport, strReportname, acFormatRTF, strExportTo &
strMonth & strCFName & strFileName, False


End If

It will export reports with the names in the ReportName column.
Will your form be positioned on the record to be exported? Or, do you want to
export some other record in the table? What are you exporting? Do you have
[quoted text clipped - 10 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top