How's this?...
EKTA:
Create separate tables for the airports, the inspectors, and the varous tests.
Set primary keys (1-to-Many) on each to maintain referential integrity; (i.e. [tblAirports] would have these two fields; [AirportID] and [AirportName] as the PK; follow the same for the other tables as well.
In your main table, include the "ID" field names from the other separate tables and set the row source for these fields to equal their counterparts; so, [AirportID] in your main table would have a row source = [tblAirports].[AirportID]; your main table's properties window will assist you in the proper syntax.
Set the following data types for you main table: [AirportID] = Autonumber, [InspectorID] = Autonumber, [TestID] = Autonumber, [Image] = Number, [Failed?] = Yes/No box, [Passed?] = Yes/No box, and [Time] = Number (seconds). ASAP...complete your table relationships now or you'll have many problems!
Remember, Access doesn't like it if you alter data types once you have entered data so KNOW that this data is and will forever be what they are; (i.e. changing from text to number can result in a massive loss of data throughout your recordset!) If a fields data is a number, it has to be forever, to avoid irregularities.
As far as your import process, once you have your Access table structure set and relationships are defined, the imports are easy. From a text file type, just copy and paste all of the text records into Excel and name your columns EXACTLY after the names that live in your main table. If the text file has label names, these should "pop" for you in Excel, just make sure that you re-name them to match your Access table field names...this will save you a lot of time on the next step...
Next, it helps to format your new Excel file columns so that they match as closely to their Access table counterparts; Text to Text, Number to Number, etc...mixing these, again can cause a loss of data.
Now, using the "Getting External Data" function in Access, call on this Excel file and import the recordset into it's own table in your Access database.
Then, create an Append query to add these records into your main table; weekly, monthly, whatever. Make sure there are no duplicates records. To check for this after the import, just create a "Find Duplicates" query and Access will find these duplicates for you. If you've mimicked the fields names, each will match when you begin your Append query process. If they don't select the field that matches the data you're trying to import (append).
I know there are ways to automate this process but I don't know Oracle8/8i or other applications to create the queries that would be required to do this.
I perform the above steps many times each week with the databases I manage and I enjoy it because it enhances and improves my use of Access and my new VBA skills...as you do the same, you'll pick up on a lot of great hints and formula writing that will help your import processes even more!
Read through some of these topics in this forum because there is a lot of great advice out there from many sharp people! - Mr. Hartman, Vassago, Mile-O-Phile, ghudson, Idjit, and many more.
I hope I've helped you out here...
ekta said:
Hi:
I have been asked to work on a database. I need some advice on how I should go about it. I have these text files which contain data and I need to import it in Access tables. The data looks like this:
ACY, 0001, SUBCER1A, 1, N, 11
ACY, 0001, SUBCER1A, 2, N, 13
ACY, 0001, SUBCER1A, 3, N, 14
ACY, 0001, SUBCER1A, 4, Y, 7
ACY is the airport, 0001 is the inspector number who enters these records. I have separate text files like these for different inspectors. SUBCER1A is the test, then image #, Y/N is the test failed or not and last column is the time in seconds. I am guessing that I need to create 2 tables. One for inspector number and the other for the fields above, with a one-to-many relationship between them.
The other thing I am having trouble with is how should I import this data in the tables? Each text file has hundreds and hundreds of records. What is the easiest way of doing this? Is it possible to automate it?
I would really appreciate any advise.
Thanks,
Ekta