I have been asked to produce an output query with the following fields
Landowner, Plot1, Area1, Description1, Requirements1, Remarks1 through to Plot32, Area32, Description32, Requirements32, Remarks32
YES 32
The column headings have to be exactly as written above.
Landowner, Plot, Area, Description, Requirements and Remarks are column headings. A landowner has many plots, numbered 1 to (potentially) 32 in the Plot column.
I’ve written some vba to loop and automatically create 32 queries, called qP1, qP2, qP32 etc.
I have some more code than creates a super query, utilising the 32 subqeries,each joined to a main table using a left join.
It starts like this “SELECT tblLandowner.Landowner, qP1.Plot AS Plot1, qP1.Area AS Area1, qP1.Description AS Description1, qP1.Req AS Req1, qP1.Remarks AS Remarks1” and goes on to list the 5 columns for each plot number group finishing at qP32.Plot AS Plot32, qP32.Area AS Area32, qP32.Description AS Description32, qP32.Req AS Req32, qP32.Remarks AS Remarks32
Trouble is the query is too complicated. I’ve just checked and found the limit on the number of tables in a query (32) however Access struggles to open the query at around 20 tables. A super query using 16 of sub queries just about opens.
I know this is hideous but has anyone got any suggestions for a different approach. I’m thinking of accepting the fact it doesn’t quite work right. It will need to be exported to excel anyway. Could do it as 2 queries say 1-16 and 17-32 and copy and paste them side by side.