Hi Guy
Yes you are right; forget what I said before, I should start with what I
want to do.
I have a table with 20 fields, I use this fields to load data from excel to
this table, but the excel spread sheets are not always the same, because from
the 20 fields in my table usually 10 or 15 get data when I import the data,
depending on the sheet.
After the data is on the table, I do some processing and export the data
back to a comma delimited file using this instruction:
Private Sub ExportFile_Click()
Dim strFileName As String
strFileName = textLocationNameFileeXP
DoCmd.TransferText acExportDelim, , "tblPeople", strFileName, True
The problem is that let say just 7 columns are fill with data some times
from 1000 rows 1 of the columns has 1 or 2 records at the bottom of the file
some times the column is all full this are the columns I want to export from
the table, the other 13 are empty I don’t want to exports those empty
columns, the problems is that the comma delimited file has the columns with
data plus the headers of the columns without data.
My question, How can I export from the table the columns with at lease 1
line with data.
example
Table
Name Lastname Address Address2
-------------------------------------------------------
John Mayes 50 Albion Rd
Mary Chu
Carlos Manso
In this case I don’t want Address2 in the .CSV file because is empty in the
table. The comma delimited file should look like that.
Comma Delimited file
Name Lastname Address
--------------------------------------
John Mayes 50 Albion Rd
Mary Chu
Carlos Manso
Let me know If you guys have any other question.