This is really pushing it ... but here is a question for you

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

we are using an access program to keep track of certain times associated with
the handling of aircraft. Some of it is rather sinple, like the scheduled
arrival and departure time, the estimated arrival and departure time and the
actual arrival and departure time. We get the majority of this information
directly from the carrier via telex (in our Outlook email). We have created
a Command button on the form called TRK. This command button completes a
link field to the internet and obtains the info. It is in graphical form.

This all works great.

But here is the question .... this information is also available in a TXT
format. i would love to be able to take this information received and read
it into the access fileds. Can this be done?

Thanks
 
If the text file has fixed width space, or separated values (CSV), you can
link or import the text file:
File | Get External
The TransferText action/method also imports text.

In practice, there's often a considerable amount more work that just this to
get the data in. You have to sort out issues such as:
- Is this a new entry, or an existing record?
- For existing records, has anything changed?
- If the entry is no longer in the text file, should it be deleted?
- Is each record valid (e.g. required fields present, unique index violated,
....)?
- Are there values in lookup fields that must be replaced with the primary
key value of a lookup table? What if the value is not in the lookup table?
- Do some of the fields need to be written to related tables (since the text
file is probably in flat-file format)?

In practice, therefore, you probably have to import the text file, run a
bunch of code that validates everything, flags any unvalidated records with
a description of what's wrong, and create a form to present these to the
user. Once the user has all critical issues solved, you enable the button
that allows the real import to execute. This typically opens a transaction,
and exeutes a series of Append, Update, and possibly Delete queries, in the
right order (e.g. append to lookup tables before the main one), and gets
user confirmation to commit the transaction or rollback if there was an
unexpected problem.
 
Back
Top