scrambled columns on export

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is a bit weird.

I am exporting a report to Excel using the following code:

DoCmd.OutputTo acOutputReport, strReportName, _
acFormatXLS, strWorkbookName, True

This worked fine until I added a couple of unbound text boxes to the report
header. Now, the columns in the worksheet are not in the same sequence as
those in the report; rather, source columns {1st, 2nd, 3rd, 4th, 5th, 6th,
7th, 8th} now map to worksheet columns {A, B, H, I, J, C, D, E, F, G}.

How can I get the columns to export in the original sequence?

Thanks!
 
Hi Allen,

check the Top and Left properties of each control -- that is what
determines the order


Warm Regards,
Crystal
*
(: have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
Hi Crystal,

I made sure all the positions and heights were consistent, and that the
bound controls were left-aligned with their respective column headings. The
report looks fine, but the exported worksheet still has scrambled columns.

Also, the column headings are not rearranged in the same way as the data, so
it's a real pain to fix the spreadsheets manually.
 
What a dummy. The output was _not_ being scrambled: I was replacing the
column headers in the spreadsheet using an ActiveX routine, and I got them
wrong.

Thanks anyway!
 
Hi Allen,

glad you found the problem! thanks for sharing ;)


Warm Regards,
Crystal
*
(: have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
Back
Top