Overwriting excel files

jekirksey

Registered User.
Local time
Today, 21:26
Joined
Feb 11, 2001
Messages
27
I have a database which allows users to import data from an excel file that is located in /forms/user.xls off the root of the database. There is a button to open the spreadsheet to edit it and a button to import the data from the spreadsheet. The problem is that the spreadsheet retains the information and if the import button is clicked a second time the information is improted twice. None of the fields on the spreadsheet correspond to the primary key in the table, so it is possible to wind up with duplicates. Is there some VBA I could add to the button's on click event after the import code that would wipe out all the rows but the top one on the spreadsheet or replace the spreadsheet with a blank one from somewhere else?? Thanks
 
I am a little lost with what you are saying. But I also have a DB that imports Excel spreadsheets and have came up with a way to stop that. I run a query that checks if a record is already in the database. I check that query to see if it is empty and then if it is empty, I allow the import. If it is not then I don't allow the import. Let me know if you need help with this.
 

Users who are viewing this thread

Back
Top Bottom