Conversion of CSV file :

achalrikhi

New Member
Joined
Nov 20, 2013
Messages
38
Hello friends,

I have a CSV file and want to convert it in a text format with some filtered data and with some formatting. This is an everyday task for me. So I made a table and imported the data in to it by the
command :

DoCmd.TransferText acImportDelim, "fo Import Specification", "fo", FileName:="C:\Users\welcome\Desktop\fo.csv", HasFieldNames:=True

Earlier I asked the question in the forum but by mistake I provided the wrong information so did not apply the solution.

Actually I have a column "SERIES", contains various series like "EQ", "BE", "DR", "BZ", "D1" and so on. And one more column with the dates having 4 / 5 current months dates and one next months date and one next to next month’s date. And every date has got several thousand records.

now the issue is that : After importing these several thousand records, I want to export it but with a specific date and with a specific series.

The other thing is that, these dates change every month so if hard coded, the problem will occur the next month.

I use this code for export :

DoCmd.TransferText acExportDelim, "NewFnoSpec", "fnoquery", "C:\Users\welcome\Desktop\FO Output.txt", True

this code is working fine but when the month will change, the code won't work.

Can anyone throw some light on this ?

Can we have a date & series picker attached to this query, so it can export the records with the specified SERIES & DATE.

Regards

Achal
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I usu build a form. the form has the 'export' button and a text box for me to enter the date.
This date is in the query that gets exported.
 
Upvote 0
I usu build a form. the form has the 'export' button and a text box for me to enter the date.
This date is in the query that gets exported.

Ranman,

Thank you for replying. That is what I thought but in a different manner like a date picker but I guess your idea is better. Let me try. I will get back again If I find any problem.

Thanks & Regards

Achal
 
Upvote 0
I usu build a form. the form has the 'export' button and a text box for me to enter the date.
This date is in the query that gets exported.


Dear ranman,

I just could not find a way to include the textbox value in a query to export the data. Can you please explain a bit more about it ?

Regards
Achal
 
Upvote 0
I usu build a form. the form has the 'export' button and a text box for me to enter the date.
This date is in the query that gets exported.

I tried putting a textbox on the for named TxtDate and in a Query ( Design mode ) under the date column, in criteria I have put [Forms]![Futures]![TxtDate] and after putting this line, the query becomes empty and no data is there. Can you please tell the solution ?

Achal
 
Upvote 0
yes, make a form, with a text box: txtDate
the query would have it in its criteria, where date = [Forms]![Futures]![TxtDate]

the export would only get those dates.
 
Upvote 0
yes, make a form, with a text box: txtDate
the query would have it in its criteria, where date = [Forms]![Futures]![TxtDate]

the export would only get those dates.

Dear ranman,

Thanks a lot for all your efforts and answers. As I said, after putting "date = [forms]![futures]![txtdate]" does not give any result and it produces blank text file.

So I have tried a little easier way. I have put this :

Like "*" & [Forms]![Futures]![txtexpdate] & "*"

and it worked fine.

Thank you once again
Regards

Achal
 
Upvote 0

Forum statistics

Threads
1,221,860
Messages
6,162,479
Members
451,769
Latest member
adyapratama

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top