Programing on export with line number

  • Thread starter Thread starter simon
  • Start date Start date
S

simon

How can I have a export number the line of so I can easily see how many
record met the criteria in the excel column? Thanks in advance
 
Simon,
if you simply need to know how many records you exported, you can count them
by using a DCount on the query or recordset before you export it.

If you want each line numbered, you can number it in the query before you
export it like this:

The Table is the name of a table in your query and field1 is the name of a
field in the table, which is a field that doesn't contain nulls.

SELECT TheTable.Field1, (SELECT Count(*) FROM TheTable As X WHERE X.Field1<=
TheTable.Field1) AS Rank
FROM TheTable
WHERE (((TheTable.Field1) Is Not Null))
ORDER BY TheTable.Field1;

Jeanette Cunningham
 
How can I have a export number the line of so I can easily see how many
record met the criteria in the excel column? Thanks in advance

You'll have to explain a bit better. Are you exporting from Access to Excel?
vice versa? Why can't you just use a totals query to count records rather than
inserting a (redundant??) line number in every record?
 
I had a field that show line number of record, when input record the 1st and
the last customer name are not in sequence, but line number field will in
sequence. when we sort customer name in ascending order, line number will not
follow as in ascending order.
 
Back
Top