A
Antonio
I posted a question on 7/1/05 In the Access Import/Export Data group. One of
the three suggestions from a very kind person named John was to "write VBA
code to read the text file line by line, assemble records, and append them to
a table." But I am looking for example of such code (as I am new to the VBA
arena) Here is the problem, I have a linked table to a text file. When you
open the link the data displays like this:
Field1 Field2 Field3
Field4 Field5
M000443990 MORA,EDUARDO N M/30
07/05/05
1440
CARDIOLOGY
M000162333 GARCIA,HOPE J F/80
07/05/05
1000
CARDIOLOGY
The desired end result would be to bring all the data into one record by
Field1 and Field Two, like this.
Field1 Field2 Field3
Field4 Field5
M000999999 MORA,EDUARDO N M/30 07/05/05 1440 CARDIOLOGY
M000123456 GARCIA,HOPE J F/80 07/05/05 1000 CARDIOLOGY
Can anyone give examples of such code? OR...since I am not terribly familiar
with VBA, can anyone suggest code that would copy Field1 into all Null fields
below it until it reaches a "Not Is Null" field, and then copy the data that
is in that field to all Null Field1 fields below it, and then again, until it
reaches the last record in the table? (I saw something in the knowledge base
about something to do with Looping Structures? perhaps?)... Example:
From this:
Field1 Field2 Field3
Field4 Field5
M000999999 MORA,EDUARDO N M/30
07/05/05
1440
CARDIOLOGY
M000123456 GARCIA,HOPE J F/80
07/05/05
1000
CARDIOLOGY
To This:
Field1 Field2 Field3
Field4 Field5
M000999999 MORA,EDUARDO N M/30
M000999999 07/05/05
M000999999 1440
M000999999
CARDIOLOGY
M000123456 GARCIA,HOPE J F/80
M000123456 07/05/05
M000123456 1000
M000123456
CARDIOLOGY
What I am thinking (hoping) is that with the same information across the
corresponding rows, I can build a query that will bring all the info together
where Field1 is the same. (field 1 is never repeated..its unique to the
person.)
Any help would be Awsome!. Thank you.
the three suggestions from a very kind person named John was to "write VBA
code to read the text file line by line, assemble records, and append them to
a table." But I am looking for example of such code (as I am new to the VBA
arena) Here is the problem, I have a linked table to a text file. When you
open the link the data displays like this:
Field1 Field2 Field3
Field4 Field5
M000443990 MORA,EDUARDO N M/30
07/05/05
1440
CARDIOLOGY
M000162333 GARCIA,HOPE J F/80
07/05/05
1000
CARDIOLOGY
The desired end result would be to bring all the data into one record by
Field1 and Field Two, like this.
Field1 Field2 Field3
Field4 Field5
M000999999 MORA,EDUARDO N M/30 07/05/05 1440 CARDIOLOGY
M000123456 GARCIA,HOPE J F/80 07/05/05 1000 CARDIOLOGY
Can anyone give examples of such code? OR...since I am not terribly familiar
with VBA, can anyone suggest code that would copy Field1 into all Null fields
below it until it reaches a "Not Is Null" field, and then copy the data that
is in that field to all Null Field1 fields below it, and then again, until it
reaches the last record in the table? (I saw something in the knowledge base
about something to do with Looping Structures? perhaps?)... Example:
From this:
Field1 Field2 Field3
Field4 Field5
M000999999 MORA,EDUARDO N M/30
07/05/05
1440
CARDIOLOGY
M000123456 GARCIA,HOPE J F/80
07/05/05
1000
CARDIOLOGY
To This:
Field1 Field2 Field3
Field4 Field5
M000999999 MORA,EDUARDO N M/30
M000999999 07/05/05
M000999999 1440
M000999999
CARDIOLOGY
M000123456 GARCIA,HOPE J F/80
M000123456 07/05/05
M000123456 1000
M000123456
CARDIOLOGY
What I am thinking (hoping) is that with the same information across the
corresponding rows, I can build a query that will bring all the info together
where Field1 is the same. (field 1 is never repeated..its unique to the
person.)
Any help would be Awsome!. Thank you.