Search results

  1. A

    Read a file and import its data into a table

    [CODE]If DCount("[TicketNoID]", "tblticketNumber", "[TicketNumber=" & tkt)[/CODE] retruns an errror "Missing),], or item in query expression'[Ticket number = 1234567' "
  2. A

    Read a file and import its data into a table

    hmmmm to tackle, I've created a separate table to store the ticket numbers (tblTicketNumber) now i am trying to check during import if a file has the same ticket number and avoid that file with the code RSTkt.AddNew If RSTkt![TicketNumber] = tkt Then...
  3. A

    Read a file and import its data into a table

    The error trap does not seem to be working for files that are between other files, earlier those files tested where the first ones to parse like changing the file name from "AAABAGAL - Copy.MIR" to "AAABAGAL.MIR" As far as i've understootd, the previous files pax variable is used in the next...
  4. A

    Read a file and import its data into a table

    Trying the below code but no change in the color for either font. If Len(pax) = 0 Then ' no passengers Name SrcFolder & srcfile As ErrorFolder & srcfile txtMIRActivity.Forecolor = vbRed txtMIRActivity.Value = Trim(txtMIRActivity.Value & vbNewLine & _...
  5. A

    Read a file and import its data into a table

    Yea that's correct. But will take time before i learn it. Now in this table i need to avoid any duplicate ticket numbers per file. How can i ignore any files with same ticket number (tkt) and move those files to a folder C:\Duplicates
  6. A

    Read a file and import its data into a table

    Ok got it all wrong. Wanted to set the table, not the form. Got ideas, sadly no knowledge with any programming language. All my projects are on the access macros.
  7. A

    Read a file and import its data into a table

    After a few work on the code with the ending loops,.........VOILA ! all Done. was wondering if i could refer the variable srcfolder to a text in another form tried SrcFolder = [Forms]![frmpath]![txtSource.Value] returns an error "Microsoft access cannot find the referenced form 'frmpath' "
  8. A

    Read a file and import its data into a table

    The A02 characters, isn't it searching for those characters in the whole file ? i mean is that what it is supposed to do. So i just need to skip the file if that line is not present, isn't that possible ?
  9. A

    Read a file and import its data into a table

    yes i wish to continue to the next file after moving the error file to the error folder or writing to a txt file. Just curious how you came to conclusion, as the error trap is checking the if condition, that is if A02 is present then continue down else display the error message.
  10. A

    Read a file and import its data into a table

    i had removed them. will add them and post agian. alss how can i set text box's for the srcfolder and dstfolder on another form tried using [Forms]![frmPath]![txtsource] did not work
  11. A

    Read a file and import its data into a table

    Yes it does, tried all possible. Nothing working
  12. A

    Read a file and import its data into a table

    Ok managed to add the file name also to the respective record imported :) Sill trying to display processed files in the text box with txtMIRActivity.Value = srcfile it only display the last file processed file name :(
  13. A

    Read a file and import its data into a table

    i just need to correct this code, which is more than enough for me to eliminate error files, well at the moment :) If Left(TextLine, 3) = Trim("A02") Then 'First A02(PAX) line pax = Trim(Mid(TextLine, 4, 30)) TKT = ALC & Trim(Mid(TextLine, 49, 10)) Passenger = TKT & " " & pax...
  14. A

    Read a file and import its data into a table

    hmmmm sounds like a better idea. will try your suggestion Thanks:)
  15. A

    Read a file and import its data into a table

    that worked well, now how can i show the list of files processed and moved to destination directory. Tried txtMIRActivity.Value = srcfile even if the above code worked it would just show all the files in soruce folder. secondly, how can i skip files if any of the fields are missing. Mostly the...
  16. A

    Read a file and import its data into a table

    Hi namliam, Correction, Do While src <> "" to Do While srcfile <> "" and Open srcFolder & src For Input As #1to Open SrcFolder & srcfile For Input As #1 with this all works well as i wanted :) Thanks a lot namliam:cool:
  17. A

    Read a file and import its data into a table

    With that link i've managed to do file at a time. Clicking the reads the file, displays in form, imports to the db and moves that file to another folder. How can i automate this ?
  18. A

    Read a file and import its data into a table

    Will post the code once completed, Sure :) Tried the same got an error "File not found" Dim src As String Dim dst As String src = Dir("C:\MIR\*.MIR") dst = "C:\MIR\Processed" Set RS = CurrentDb.OpenRecordset("tblMIR") Do While src <> "" DoCmd.Hourglass...
  19. A

    Read a file and import its data into a table

    Done ! Managed to add data of the text file to the table. How can i automate this ? like read all files with extention .txt in a folder and move processed file into C:\Processed with current date
  20. A

    Read a file and import its data into a table

    ok got it changed set rs = currentdb.openrecordset("YourTable") 'Opens a table to set rs = RecordSet
Back
Top Bottom