Hi
I need to export a form's data to Excel. I am doing this with the following code:
DoCmd.OutputTo acOutputForm, "LegalEntities", acFormatXLS, "C:\A.xls", False
I then open up the Excel spreadsheet and enter some formulas and rearrange the data as necessary. This is all done through VBA code.
Now, this all works fine for forms where I know how many rows of data the recordsource has as I can work out where I can insert cells, change forumlas, etc.
However, I now need to export the data from a form with drop downs, which means that sometimes the recordsource has 1 row...sometimes it has 50 rows.
So, to start adding forumlas to th spreadsheet I need to do it after all the data has been displayed.
I thought I could do this by counting the rows in the recordsource. Say, it had 50, I could then start editing Excel with my code at cell A52.
Any ideas?
I need to export a form's data to Excel. I am doing this with the following code:
DoCmd.OutputTo acOutputForm, "LegalEntities", acFormatXLS, "C:\A.xls", False
I then open up the Excel spreadsheet and enter some formulas and rearrange the data as necessary. This is all done through VBA code.
Now, this all works fine for forms where I know how many rows of data the recordsource has as I can work out where I can insert cells, change forumlas, etc.
However, I now need to export the data from a form with drop downs, which means that sometimes the recordsource has 1 row...sometimes it has 50 rows.
So, to start adding forumlas to th spreadsheet I need to do it after all the data has been displayed.
I thought I could do this by counting the rows in the recordsource. Say, it had 50, I could then start editing Excel with my code at cell A52.
Any ideas?