Greetings all!
I have a dilemma that I'm trying to have resolved within the next week or so.
The short of it is the following. I need to create a VBA code that will import a fixed width .txt document that has record lead indicators (at the start of each records) to indicate what that particular records pertains too. I need the VBA code to understand what the indicator is, then input the data into the correct cell of the table.
That's the short of it, now the long part.
Here is a test .txt file that I need to import:
http://www.geocities.com/diretemus/testfile.TXT
And here is a description of the file layout:
http://www.geocities.com/diretemus/t...sionlayout.rtf
The table this information will be imported into will have the following fields:
ProxyVoteID (Primary Key)
VoteDate (DataType - Date)
CUSIP (DataType - Number)
Class (DataType - Number)
RecordDate (DataType - Date [Format = YYMMDD])
MeetingDate (DataType - Date [Format = YYMMDD])
BRClientNum (DataType - Number)
DTCNumber (DataType - Number)
NomineeName (DataType - Text)
TotalShares (DataType - Number)
ProposalFOR01 - ProposalFOR99 (DataType - Number) 99 Columns to accommodate up to 99 Proposals
ProposalAGAINST01 - ProposalAGAINST99 (DataType - Number) 99 Columns to accommodate up to 99 Proposals
ProposalABSTAIN01 - ProposalABSTAIN99 (DataType - Number) 99 Columns to accommodate up to 99 Proposals
Director01 - Director99 (DataType - Number) 99 Columns to accommodate up to 99 Directors
Now as you can see each record has a lead record indicator:
I.E. If a record is lead by 401, we know the corresponding numbers to the right refer to Proposal1. We can then pull (based off of the fixed width) the values for ProposalFOR1, ProposalAGAINST1 & ProposalABSTAIN1.
What I need this VBA code to do is, once it hits a record lead by 250, it should import the data in the text document based off of the next records until it hits another record lead by 250, at that point it should start importing the information into a new record of the table.
I've been trying to find information inside these WROX VBA Access books specific to importing text documents that are fixed width and I can't seem to get it.
If anyone can lead me in the right direction, I would greatly appreciate it! :)
Thanks for all the help!