Update Query Help

AC5FF

Registered User.
Local time
Today, 05:43
Joined
Apr 6, 2004
Messages
552
I am importing data from a text file. I am going to need help w/automating this, but for now it is working. Here is a copy of the TXT file I am importing for reference to this problem...
Code:
AC5FFTMP HIGHEST COUNT INFO
07-07-2011

029-001-01  00-02  .z.z.h.z.z.z.z.z.z.z|z.z.z.z.z.z.-.-.-.-|-.-.-.-.-.-.-.-.-.-|-.-.-.-.-.-.    .15 .    .    .    .    . 
029-001-02  00-00  .z.z.z.z.z.z.z.z.z.z|z.z.z.z.z.z.z.z.z.z|z.z.z.z.z.z.z.h.z.z|z.z.z.z.z.z.    .36 .    .    .    .    . 
029-001-03  00-00  .z.z.z.z.z.z.z.z.z.z|z.z.z.z.z.z.z.z.h.z|z.z.z.z.-.-.-.-.-.-|-.-.-.-.-.-.    .24 .    .    .    .    . 
029-001-04  00-01  .z.z.z.z.z.z.h.z.z.z|z.z.z.z.z.z.z.h.z.z|z.z.z.z.-.-.-.-.-.-|-.-.-.-.-.-.    .22 .    .    .    .    .
The way I am importing the data is using an Import Specification and fixed column widths. The first two lines are eventually deleted, but before I delete it I need to pull out the date information (line2) and update each row with that date.

The way the 'Fixed Width' import is working breaks the date in row2 into two columns (07-07 and 11). I can combine that into a single field with a query, but I can't figure out how to update from that query.

Any Suggestions?
 
the docmd.transfertext method alone will not suffice here. you better use a combination of opening the import file and read the first two lines to extract the date info you need.
and then use the docmd.transfertext option to import the complete file.
when the file was imported you can update the date field with the appropriate date.

HTH:D
 
I've not used the 'docmd.transfertext' -- I'm assuming that is VBA whereas I have been using macros. I really need to start to learn VBA!! :D I know there is TONS more you can do with it.
Is it possible to only transfer - say line2 of a txt file into Access and ignore everything else?
 

Users who are viewing this thread

Back
Top Bottom