I want to write an Access 2010 query which should do the following:
- Loop through Table 'Schools', with just one field (SchoolName).
- Use each value in the first table to select records from Table 'ChildData', with several fields about individual children, including which school they attend (SchoolName).
- For each school, export the data for its attending children into a separate Excel workbook (.xlsx) that contain the name of the school.
In my search I found the following code:
SELECT ChildData.* INTO [Excel 8.0;HDR=YES;IMEX=2;DATABASE=C:\Example.xls].[MyWorksheet]
FROM ChildData INNER JOIN Schools ON ChildData.SchoolName = Schools.SchoolName;
Taking in consideration that by Access knowledge is nearly non-existing (can just do the basics) I tried to run this query and received the following error and have no idea how to resolve it.
Cannot update. Database or object is read-only
I did do all the steps found on article - http://support.microsoft.com/default...;en-US;2581301
Is there anybody that could be so kind as to steer me in the right direction?