Using DoCmd.OutputTo acOutputReport and a field is outputting as Text, needs to be Number/Percent
Posted on 2012-04-06
When my code executes, it is outputting one of the fields as Text and I need it to output as a Number with a Percent sign and two decimals. Nothing happens and the field stays as text. What am I doing wrong?
Below is the code that I am using:
strOutputToPath = "C:\Windows\Temp\Manager_Report" & "_" & Format(Date, "mm-dd-yyyy") & ".XLS"
DoCmd.OutputTo acOutputReport, "rptManager_Report", acFormatXLS, strOutputToPath, False
rtn = MsgBox("Would you like to open the Report now?", vbYesNo)
If rtn = vbYes Then
Set app1 = CreateObject("Excel.Application")
app1.Visible = True
app1.Columns("D").NumberFormat = "General"