Re: Using IIF to prevent duplicate Imports

From: Douglas J. Steele (NOSPAM_djsteele_at_NOSPAM_canada.com)
Date: 10/12/04


Date: Tue, 12 Oct 2004 15:46:09 -0400

Easiest way would be to create a query that compares the temporary table to
the "permanent" one.

Open a recordset based on that comparison query. If the recordset is empty,
you know it's safe to import the data. If not, issue your message.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(No private e-mails, please)
"Ndel40" <Ndel40@discussions.microsoft.com> wrote in message
news:62B7525C-C4A7-45BD-8438-CAB2304BCFE8@microsoft.com...
> I have a table that is populated with data by importing a text file
created
> from a SAP download once per week.  I have automated the process, however,
I
> see a potential problem with duplicating data due to overlapping SAP
download
> date ranges.
>
> In order to prevent duplication, I would like to import the text file to a
> temporary table, create a concatenated field for several of the imported
> fields and compare the concatenation to the same concatenation in the
master
> table.
>
> I would like use and "if" statement that does the evaluation and if no
> duplicates are found the data is imported and appended to the master
table.
> If duplicates exist, find the max data and time from the master table and
> display a message. something like this:
>
> If no duplicated records exist then
>
> Import the text file and append it to the master data file
> Else
> Display a message that says "Data already exists - The last record
imported
> was 10/11/04 12:31:00 PM.  Please re-run the SAP download"
>
> Endif
>
> I'm sure there are other ways to accomplish what I need. any ideas are
> welcome.
>
> FYI. I am using Access 97.
>
> Thanks,
>
> Nick
>
>
>


Relevant Pages

  • Re: Using IIF to prevent duplicate Imports
    ... > Open a recordset based on that comparison query. ... >> I have a table that is populated with data by importing a text file ... >> duplicates are found the data is imported and appended to the master ...
    (microsoft.public.access.modulesdaovba)
  • Count Number of Appended Lines for Msgbox
    ... are being appended from one table to another (from SUB to MASTER) and display ... it in a MsgBox. ... Dim myRecordset As New ADODB.Recordset ... 'SQL statement to populate Recordset ...
    (microsoft.public.access.modulesdaovba)
  • Re: Company Name Duplicates
    ... To look for duplicates, you would first create a recordset of your data entry ... Dim Rst As DAO.Recordset ... > Evan McCutchen ...
    (microsoft.public.access.formscoding)
  • Re: Getting duplicates but I dont know why
    ... > duplicates both programs can interigate the database and see ... > Dim OutRecordset As ADODB.Recordset ... > UpdatePatient InRecordset, OutRecordset, LogFileNumber ... If I use Countthen I can't have a Recordset with the fields ...
    (microsoft.public.vb.database.ado)
  • Re: Indicating Stored Procedure progress on Form
    ... You put this in your master procedure. ... You may also have to take a look at the state property of the recordset ... using a second connection should have worked. ... Sylvain Lafontaine, ing. ...
    (microsoft.public.access.adp.sqlserver)