check for and entry

  • Thread starter Thread starter Jordan Shoderu
  • Start date Start date
J

Jordan Shoderu

i have an importation process (VBA module) that imports all the sheets from
an excel work book into acsess tables(multiple rows)

is there anyway i can add to a piece of code to my already existing code so
that is can check to see if the enteries are already there and for a little
messege to appear saying enteries already exist in database importation
process stopped

please can anyone help me

Jordan
 
If you have a unique field in what you are importing, the easiest thing to
do may be to create a unique index on that field in the receiving table.
This will then generate an error that you could trap in the form's Error
event when you try to paste duplicate data into that field. Another option
would be to paste into a temporary table first or link to the spread sheet
as a table and query on that and the destination table with the two tables
linked. If any records are returned, it would mean that there are records in
what you're trying to import that already exist.
 

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