Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2015
    Posts
    3

    Unanswered: Text Box and Query !

    Hello,

    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 other 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.

    I tried putting a textbox on the form 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.

    Regards

    Achal

  2. #2
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    IS the DATE in the table a datevlaue of is it text feild
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  3. #3
    Join Date
    Jun 2015
    Posts
    3
    Quote Originally Posted by myle View Post
    IS the DATE in the table a datevlaue of is it text feild
    Dear Myle,

    In the table the DATE field is of DATE value and not text.

    Regards

    Achal

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    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.

    ...what specific date, what specific series.....
    if you specified a limited date range using a hard coded value then it will only EVER return data that falls within that range
    so either change your export specification to be more flexible, say using a relative date limit as opposed to a hard coded limit
    OR
    write a query to the querydefs collection and use that as the source for your export.

    you can write to the querydefs collection using a from to specify whatever date / other limitations on the date required. using a form to act as a fronbt end you can validate the user input so its 'sane'. this is a better approach than, say, using parameters inside the query itself
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Jun 2015
    Posts
    3
    Thank you all for your kind effort to answer my question.


    Your answers were quite helpful. I have tried a little easier way and it worked for me. I put a text box named txtexpdate, on the form and in the query ( design mode ), in criteria I have put this :

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

    This is working fine at this juncture. And thank you once again for your efforts to answer my question. Hope this also will help others as an option to this problem.

    Regards

    Achal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •