Compare value in 1 table to a other table.

Jordan2000

Registered User.
Local time
Tomorrow, 00:07
Joined
Nov 4, 2004
Messages
24
I' m trying to compare a value in the import table against a value in a other table to check if this dealer is already is imported.

AantalRec = aantal("Tmp_Import")
MsgBox (AantalRec)

For i = 1 To AantalRec

SQLQ1 = "SELECT Tmp_Import.[Dealernummer Vestiging]FROM TblDealer INNER JOIN Tmp_Import ON TblDealer.[Dealernummer Vestiging] = Tmp_Import.[Dealernummer Vestiging] WHERE ((Not (Tmp_Import.[Dealernummer Vestiging])=[TblDealer]![Dealernummer Vestiging]));"
Set rs = CurrentDb.OpenRecordset(SQLQ1)

MsgBox rs

But this is not giving anything only a error.
like Type are not the same ..
 
Try using a DCount() to test if the ID # is already in the table. Search for examples of DCount() if you need more info.
 
What are you trying to display in the msgbox, the dealers that have already been imported or the new ones?

Peter
 
The new dealers. @ this moment this is already fixed on a Diferent way.
with a Access Qry.

I am no going to find out how to copy those with a insert Qry when validated is true.
the data is coming from 3 diferent tables the import, NAW & the select qry with the new dealers.

it is somthing like insert into tbl_dealer where me.valuefield.value .. ore somting like that..
 

Users who are viewing this thread

Back
Top Bottom