Too many fields defined

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a set of queries which each has 6 or 7 fields. They are being exported
to the same spreadsheet but one query is throwing up this error.
 
What is the SQL of the query that is failing?

Does that query run if you just call it?



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Opening the query is fine.




John Spencer said:
What is the SQL of the query that is failing?

Does that query run if you just call it?



--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Ok, then what is the SQL of the query?

What is the code (or method) that you are using to export the query results?
How many records are returned by the query?

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
This error is now occurring with a second query. Each query is returning
about 10 records.

output method

DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "Report_Outstanding_BILL", _
"C:\Outstanding Queries Spreadsheet.xls", , "BILLING"

SQL

SELECT tble_Query.QueryID AS Query, tble_Query.Qry_ChaseDate AS Chase,
DateDiff("d",[Qry_Chasedate],Date()) AS Diff, tble_Query.Cont_InvName AS
Investigator, tble_Query.Fin_CInvNo, tble_Query.Fin_InvNo,
tble_Query.CustomerName AS Customer
FROM tble_Query
WHERE (((tble_Query.Qry_Current)="Finance") AND
((tble_Query.Qry_Status)="outstanding"))
ORDER BY DateDiff("d",[Qry_Chasedate],Date()) DESC;
 
Any chance the number of columns in the BILLING range doesn't match the
number of fields in the query?

Does it make any difference if you write to a different folder? It may make
a difference, depending on your version of Windows and administrative
priviliges.

Does changing the Excel version to an older one make any difference?

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

scubadiver said:
This error is now occurring with a second query. Each query is returning
about 10 records.

output method

DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "Report_Outstanding_BILL", _
"C:\Outstanding Queries Spreadsheet.xls", , "BILLING"

SQL

SELECT tble_Query.QueryID AS Query, tble_Query.Qry_ChaseDate AS Chase,
DateDiff("d",[Qry_Chasedate],Date()) AS Diff, tble_Query.Cont_InvName AS
Investigator, tble_Query.Fin_CInvNo, tble_Query.Fin_InvNo,
tble_Query.CustomerName AS Customer
FROM tble_Query
WHERE (((tble_Query.Qry_Current)="Finance") AND
((tble_Query.Qry_Status)="outstanding"))
ORDER BY DateDiff("d",[Qry_Chasedate],Date()) DESC;

John Spencer said:
Ok, then what is the SQL of the query?

What is the code (or method) that you are using to export the query
results?
How many records are returned by the query?

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
I have 16 queries all going to the same spreadsheet. The spreadsheet is
being saved with 14 queries and each one is pretty much identical. There are
two that are not being exported.

What do you mean by "billing range"?

Allen Browne said:
Any chance the number of columns in the BILLING range doesn't match the
number of fields in the query?

Does it make any difference if you write to a different folder? It may make
a difference, depending on your version of Windows and administrative
priviliges.

Does changing the Excel version to an older one make any difference?

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

scubadiver said:
This error is now occurring with a second query. Each query is returning
about 10 records.

output method

DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "Report_Outstanding_BILL", _
"C:\Outstanding Queries Spreadsheet.xls", , "BILLING"

SQL

SELECT tble_Query.QueryID AS Query, tble_Query.Qry_ChaseDate AS Chase,
DateDiff("d",[Qry_Chasedate],Date()) AS Diff, tble_Query.Cont_InvName AS
Investigator, tble_Query.Fin_CInvNo, tble_Query.Fin_InvNo,
tble_Query.CustomerName AS Customer
FROM tble_Query
WHERE (((tble_Query.Qry_Current)="Finance") AND
((tble_Query.Qry_Status)="outstanding"))
ORDER BY DateDiff("d",[Qry_Chasedate],Date()) DESC;

John Spencer said:
Ok, then what is the SQL of the query?

What is the code (or method) that you are using to export the query
results?
How many records are returned by the query?

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..


Opening the query is fine.

:

What is the SQL of the query that is failing?

Does that query run if you just call it?

I have a set of queries which each has 6 or 7 fields. They are being
exported
to the same spreadsheet but one query is throwing up this error.
 
You posted the export statement as:

DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "Report_Outstanding_BILL", _
"C:\Outstanding Queries Spreadsheet.xls", , "BILLING"

The last argument, "BILLING", refers to the target range of cells in the
spreadsheet.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

scubadiver said:
I have 16 queries all going to the same spreadsheet. The spreadsheet is
being saved with 14 queries and each one is pretty much identical. There
are
two that are not being exported.

What do you mean by "billing range"?

Allen Browne said:
Any chance the number of columns in the BILLING range doesn't match the
number of fields in the query?

Does it make any difference if you write to a different folder? It may
make
a difference, depending on your version of Windows and administrative
priviliges.

Does changing the Excel version to an older one make any difference?

scubadiver said:
This error is now occurring with a second query. Each query is
returning
about 10 records.

output method

DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "Report_Outstanding_BILL", _
"C:\Outstanding Queries Spreadsheet.xls", , "BILLING"

SQL

SELECT tble_Query.QueryID AS Query, tble_Query.Qry_ChaseDate AS Chase,
DateDiff("d",[Qry_Chasedate],Date()) AS Diff, tble_Query.Cont_InvName
AS
Investigator, tble_Query.Fin_CInvNo, tble_Query.Fin_InvNo,
tble_Query.CustomerName AS Customer
FROM tble_Query
WHERE (((tble_Query.Qry_Current)="Finance") AND
((tble_Query.Qry_Status)="outstanding"))
ORDER BY DateDiff("d",[Qry_Chasedate],Date()) DESC;

:

Ok, then what is the SQL of the query?

What is the code (or method) that you are using to export the query
results?
How many records are returned by the query?

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..


Opening the query is fine.

:

What is the SQL of the query that is failing?

Does that query run if you just call it?

message
I have a set of queries which each has 6 or 7 fields. They are
being
exported
to the same spreadsheet but one query is throwing up this error.
 
For me it names the sheet within the workbook! same thing? It works for
every query.




Allen Browne said:
You posted the export statement as:

DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "Report_Outstanding_BILL", _
"C:\Outstanding Queries Spreadsheet.xls", , "BILLING"

The last argument, "BILLING", refers to the target range of cells in the
spreadsheet.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

scubadiver said:
I have 16 queries all going to the same spreadsheet. The spreadsheet is
being saved with 14 queries and each one is pretty much identical. There
are
two that are not being exported.

What do you mean by "billing range"?

Allen Browne said:
Any chance the number of columns in the BILLING range doesn't match the
number of fields in the query?

Does it make any difference if you write to a different folder? It may
make
a difference, depending on your version of Windows and administrative
priviliges.

Does changing the Excel version to an older one make any difference?


This error is now occurring with a second query. Each query is
returning
about 10 records.

output method

DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "Report_Outstanding_BILL", _
"C:\Outstanding Queries Spreadsheet.xls", , "BILLING"

SQL

SELECT tble_Query.QueryID AS Query, tble_Query.Qry_ChaseDate AS Chase,
DateDiff("d",[Qry_Chasedate],Date()) AS Diff, tble_Query.Cont_InvName
AS
Investigator, tble_Query.Fin_CInvNo, tble_Query.Fin_InvNo,
tble_Query.CustomerName AS Customer
FROM tble_Query
WHERE (((tble_Query.Qry_Current)="Finance") AND
((tble_Query.Qry_Status)="outstanding"))
ORDER BY DateDiff("d",[Qry_Chasedate],Date()) DESC;

:

Ok, then what is the SQL of the query?

What is the code (or method) that you are using to export the query
results?
How many records are returned by the query?

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..


Opening the query is fine.

:

What is the SQL of the query that is failing?

Does that query run if you just call it?

message
I have a set of queries which each has 6 or 7 fields. They are
being
exported
to the same spreadsheet but one query is throwing up this error.
 
I am not sure what happened but my undefined fields error no longer occurred
and the two queries is now exported.


Allen Browne said:
You posted the export statement as:

DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "Report_Outstanding_BILL", _
"C:\Outstanding Queries Spreadsheet.xls", , "BILLING"

The last argument, "BILLING", refers to the target range of cells in the
spreadsheet.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

scubadiver said:
I have 16 queries all going to the same spreadsheet. The spreadsheet is
being saved with 14 queries and each one is pretty much identical. There
are
two that are not being exported.

What do you mean by "billing range"?

Allen Browne said:
Any chance the number of columns in the BILLING range doesn't match the
number of fields in the query?

Does it make any difference if you write to a different folder? It may
make
a difference, depending on your version of Windows and administrative
priviliges.

Does changing the Excel version to an older one make any difference?


This error is now occurring with a second query. Each query is
returning
about 10 records.

output method

DoCmd.TransferSpreadsheet acExport, _
acSpreadsheetTypeExcel9, "Report_Outstanding_BILL", _
"C:\Outstanding Queries Spreadsheet.xls", , "BILLING"

SQL

SELECT tble_Query.QueryID AS Query, tble_Query.Qry_ChaseDate AS Chase,
DateDiff("d",[Qry_Chasedate],Date()) AS Diff, tble_Query.Cont_InvName
AS
Investigator, tble_Query.Fin_CInvNo, tble_Query.Fin_InvNo,
tble_Query.CustomerName AS Customer
FROM tble_Query
WHERE (((tble_Query.Qry_Current)="Finance") AND
((tble_Query.Qry_Status)="outstanding"))
ORDER BY DateDiff("d",[Qry_Chasedate],Date()) DESC;

:

Ok, then what is the SQL of the query?

What is the code (or method) that you are using to export the query
results?
How many records are returned by the query?

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..


Opening the query is fine.

:

What is the SQL of the query that is failing?

Does that query run if you just call it?

message
I have a set of queries which each has 6 or 7 fields. They are
being
exported
to the same spreadsheet but one query is throwing up this error.
 
Back
Top