Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing a delimited text file into Access using a control button. 1

Status
Not open for further replies.

deevaetodin

Technical User
Jun 22, 2001
80
US
I was wondering if someone can give me some insight on how to do the following.

I have built a form in Access, I would like to have a control button whereby pressing it would prompt the user to select a text tab delimited file to be imported into the current database as a new table.

Further upon importing I would like to remove all duplicates but maintain any data associated with that duplicate that would be distinct for that row.

For example, I have 3 entries for Client "J. SMITH", J. SMITH orders 5 x Product B of in entry one. In entry two J. SMITH orders 4 x Product A. In entry three J. SMITH orders 1 x Product B and 3 X Product A.

When creating the table after depressing the control button and selecting the file is there anyway of automatically collapsing all entries for J. SMITH to one entry so that we would maintain all of his orders, leaving one entry with J. SMITH having 6 x Product B & 7 x Product A.

Any insight and all help would be greatly appreciated.
 
1. Easy way- Create a macro. Use Run Command. This'll take you to the import dialog box. You'll still have to specify the file type....

2. Create a table and set a unique index. In your example, most likely client name. Use an append query to import into that table. Access will automatically not append any duplicate records.

 
Thanks,

I will give this a shot.

Much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top