Hi guys,
I'm trying to help a friend who has very old legacy system written in some ancient language that hasn't been supported for decades. He has purchased some new software to replace the old system but the old historical data could not be imported into the new system so he keeps the old system around so that he can access it when he needs to.....one day it's going to die and it will cause him lots of issues..
My friend operates an automotive mechanical repair workshop and the old system system is basically an invoicing system.
I essentially want to import a subset of the data into Access 2007 and build him a simple to use interface so that he can more easily find his historical data.
I have figured out that the data can be read directly by Excel and whilst I don't have a problem importing most of the data, I am having a problem figuring out how to import the individual invoices as they are all stored as separate files in a single folder under a unique file name.
I have found a file that contains a list of all invoices with the customer number etc and this is easy to import into Access.
I have attached one of the invoice files so that you can see what it looks like. the first record I would think would be used as a Header record to match field names. The file is called "A0011204.ONQ" and can be opened directly by Excel.
I want some code, probably VBA, that will skip though all of the files in the folder, import the data into a single table called "tInvoices" and add the file name into a field called "InvoiceNumber" of each record. This way, if the original invoice has 20 lines in it, "tInvoices" will also contain 20 separate records for each line plus the additional field called "InvoiceNumber" that would be set to the name of the file...for example "A0011204".
As this type of code is above my "pay scale", I'm hoping somebody can help me solve this issue.
Thanks for any help you can provide me.
Cheers
Greg
I'm trying to help a friend who has very old legacy system written in some ancient language that hasn't been supported for decades. He has purchased some new software to replace the old system but the old historical data could not be imported into the new system so he keeps the old system around so that he can access it when he needs to.....one day it's going to die and it will cause him lots of issues..
My friend operates an automotive mechanical repair workshop and the old system system is basically an invoicing system.
I essentially want to import a subset of the data into Access 2007 and build him a simple to use interface so that he can more easily find his historical data.
I have figured out that the data can be read directly by Excel and whilst I don't have a problem importing most of the data, I am having a problem figuring out how to import the individual invoices as they are all stored as separate files in a single folder under a unique file name.
I have found a file that contains a list of all invoices with the customer number etc and this is easy to import into Access.
I have attached one of the invoice files so that you can see what it looks like. the first record I would think would be used as a Header record to match field names. The file is called "A0011204.ONQ" and can be opened directly by Excel.
I want some code, probably VBA, that will skip though all of the files in the folder, import the data into a single table called "tInvoices" and add the file name into a field called "InvoiceNumber" of each record. This way, if the original invoice has 20 lines in it, "tInvoices" will also contain 20 separate records for each line plus the additional field called "InvoiceNumber" that would be set to the name of the file...for example "A0011204".
As this type of code is above my "pay scale", I'm hoping somebody can help me solve this issue.
Thanks for any help you can provide me.
Cheers
Greg