How do I make a script so I dont update twice?

  • Thread starter Thread starter oais1
  • Start date Start date
O

oais1

Hi,

I'm trying to build a VBA code in Access that dumps Excel data into a
Access Table (Appends it to Table).

My existing Code takes data from Excel and pops it into Access Table.
However, If I click the macro twice it duplicates the data in th
field.

HOW DO I DO THIS PUHLEEASE:

Before it updates the data into the access table, it compares the exce
field with the last data entry in Access, and if its the same say
"you've already entered this record".

Thanks
 
Referential integrity in the database is used to prevent this kind of
thing, not code in the client application.

Get your table's schema correct. Add constraints to your table,
including but not limited to a real primary key (am I right in
thinking you've used one of those useless INDENTITY/Autonumber columns
as you PK?)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top