G
Guest
hi,
i have the following:
Dim strSQLCommand6 As String
strSQLCommand6 = "INSERT INTO tbl_masterpop_main " _
& "([Loan Acct #], [Status], [PopEnterDt], " _
& "[chg off date], [loan status], [inventory status], [active bk flag], " _
& "[active inactive flag], [paid off?], [payoff date], [days delinquent], " _
& "[amended this mo?], [extended this mo?]) " _
& "SELECT [Loan Acct #], [Status], [PopEnterDt], " _
& "[chg off date], " _
& "[loan status], " _
& "[inventory status], " _
& "[active bk flag], " _
& "[active inactive flag], " _
& "[paid off?], " _
& "[payoff date], " _
& "[days delinquent], " _
& "[amended this mo?], " _
& "[extended this mo?] " _
& "FROM up_tbl_masterpop_main;"
DoCmd.RunSQL strSQLCommand6
when i click the button, duplicate records ar ebeing coped into
tbl_masterpop_main, even if the [loan acct #] exists already in the
tbl_masterpop_main. what do I need to do?
for referecne, here is the up_tbl_masterpop_main query:
SELECT "In Table 1" AS Source
, tbl_masterpop.[Loan Acct #]
, tbl_masterpop.[Status]
,tbl_masterpop.[PopEnterDt]
,tbl_masterpop.[chg off date], tbl_masterpop.[loan status],
tbl_masterpop.[inventory status], tbl_masterpop.[active bk flag],
tbl_masterpop.[active inactive flag], tbl_masterpop.[paid off?],
tbl_masterpop.[payoff date], tbl_masterpop.[days delinquent],
tbl_masterpop.[amended this mo?], tbl_masterpop.[extended this mo?]
FROM tbl_masterpop LEFT JOIN tbl_masterpop_new
ON tbl_masterpop.[Loan Acct #] = tbl_masterpop_new.[Loan Acct #]
WHERE tbl_masterpop_new.[Loan Acct #] is Null
UNION ALL SELECT "In Table 2" as Source
, tbl_masterpop_new.[Loan Acct #]
, tbl_masterpop_new.[Status]
,tbl_masterpop_new.[PopEnterDt]
,tbl_masterpop_new.[chg off date], tbl_masterpop_new.[loan status],
tbl_masterpop_new.[inventory status], tbl_masterpop_new.[active bk flag],
tbl_masterpop_new.[active inactive flag], tbl_masterpop_new.[paid off?],
tbl_masterpop_new.[payoff date], tbl_masterpop_new.[days delinquent],
tbl_masterpop_new.[amended this mo?], tbl_masterpop_new.[extended this mo?]
FROM tbl_masterpop_new LEFT JOIN tbl_masterpop
ON tbl_masterpop_new.[Loan Acct #] = tbl_masterpop.[Loan Acct #]
WHERE tbl_masterpop.[Loan Acct #] is Null;
thanks in advance,
geebee
i have the following:
Dim strSQLCommand6 As String
strSQLCommand6 = "INSERT INTO tbl_masterpop_main " _
& "([Loan Acct #], [Status], [PopEnterDt], " _
& "[chg off date], [loan status], [inventory status], [active bk flag], " _
& "[active inactive flag], [paid off?], [payoff date], [days delinquent], " _
& "[amended this mo?], [extended this mo?]) " _
& "SELECT [Loan Acct #], [Status], [PopEnterDt], " _
& "[chg off date], " _
& "[loan status], " _
& "[inventory status], " _
& "[active bk flag], " _
& "[active inactive flag], " _
& "[paid off?], " _
& "[payoff date], " _
& "[days delinquent], " _
& "[amended this mo?], " _
& "[extended this mo?] " _
& "FROM up_tbl_masterpop_main;"
DoCmd.RunSQL strSQLCommand6
when i click the button, duplicate records ar ebeing coped into
tbl_masterpop_main, even if the [loan acct #] exists already in the
tbl_masterpop_main. what do I need to do?
for referecne, here is the up_tbl_masterpop_main query:
SELECT "In Table 1" AS Source
, tbl_masterpop.[Loan Acct #]
, tbl_masterpop.[Status]
,tbl_masterpop.[PopEnterDt]
,tbl_masterpop.[chg off date], tbl_masterpop.[loan status],
tbl_masterpop.[inventory status], tbl_masterpop.[active bk flag],
tbl_masterpop.[active inactive flag], tbl_masterpop.[paid off?],
tbl_masterpop.[payoff date], tbl_masterpop.[days delinquent],
tbl_masterpop.[amended this mo?], tbl_masterpop.[extended this mo?]
FROM tbl_masterpop LEFT JOIN tbl_masterpop_new
ON tbl_masterpop.[Loan Acct #] = tbl_masterpop_new.[Loan Acct #]
WHERE tbl_masterpop_new.[Loan Acct #] is Null
UNION ALL SELECT "In Table 2" as Source
, tbl_masterpop_new.[Loan Acct #]
, tbl_masterpop_new.[Status]
,tbl_masterpop_new.[PopEnterDt]
,tbl_masterpop_new.[chg off date], tbl_masterpop_new.[loan status],
tbl_masterpop_new.[inventory status], tbl_masterpop_new.[active bk flag],
tbl_masterpop_new.[active inactive flag], tbl_masterpop_new.[paid off?],
tbl_masterpop_new.[payoff date], tbl_masterpop_new.[days delinquent],
tbl_masterpop_new.[amended this mo?], tbl_masterpop_new.[extended this mo?]
FROM tbl_masterpop_new LEFT JOIN tbl_masterpop
ON tbl_masterpop_new.[Loan Acct #] = tbl_masterpop.[Loan Acct #]
WHERE tbl_masterpop.[Loan Acct #] is Null;
thanks in advance,
geebee