John,
Sorry, let me try to clarify. On a new form, I have an option group listing
the tables I want to export to excel. I want to be able to click on the
individual table I want in the option group, then click a command button
"export". Then the data within the table exports to excel. Does this help?
No, because I do not know the structure of your form or your table.
Again:
The Option Group *DISPLAYS* the names of some tables. That's just pure
text in the definition of the option group control.
The Option group does not *CONTAIN* those tables.
When you click on the third line of the option group, Access returns
the numeric value 3 (or whatever the value of that third row might
be).
Somewhere in your application is the information that 3 refers to
tblMyTableX. I don't know where that information is stored; maybe it
isn't stored.
You need to find the linkage between 3 and MyTableX, and in the Click
event of the command button, use the TransferSpreadsheet method to
export that table to Excel. Open the VBA editor and look for Help on
TransferSpreadsheet to see how one would do this.
John W. Vinson [MVP]