Adding an ID number to XLS output file name

  • Thread starter Thread starter Robin Chapple
  • Start date Start date
R

Robin Chapple

I am attempting to output club records from an Access database to an
XLS format on a per club basis using a command button and a parameter
query.

I can output the single club file with this line:

DoCmd.OutputTo acQuery, "qryRollCall2XLS",
"MicrosoftExcelBiff8(*.xls)", "E:\###\Database.xls", True, "", 0

using the parameter query.

I then attempted to make separate XLS files per club with this which
is based on code I use to make RTF output from a report.

DoCmd.OutputTo acQuery, "qryRollCall2XLS",
"MicrosoftExcelBiff8(*.xls)", "E:\###\" & "Database_ID" & Me![Club
Ident] & ".xls", True, "", 0

I have not adapted it correctly because the error message reports that
it can't find the field [Club Ident].

The next task will be to learn about making the separate XLS files
without the need to use the commend button 60 times.

Robin Chapple
 
Hi Robin,

Does your form have a control on it called "Club Ident" which contains
the club's ID number?

I am attempting to output club records from an Access database to an
XLS format on a per club basis using a command button and a parameter
query.

I can output the single club file with this line:

DoCmd.OutputTo acQuery, "qryRollCall2XLS",
"MicrosoftExcelBiff8(*.xls)", "E:\###\Database.xls", True, "", 0

using the parameter query.

I then attempted to make separate XLS files per club with this which
is based on code I use to make RTF output from a report.

DoCmd.OutputTo acQuery, "qryRollCall2XLS",
"MicrosoftExcelBiff8(*.xls)", "E:\###\" & "Database_ID" & Me![Club
Ident] & ".xls", True, "", 0

I have not adapted it correctly because the error message reports that
it can't find the field [Club Ident].

The next task will be to learn about making the separate XLS files
without the need to use the commend button 60 times.

Robin Chapple
 
Back
Top