A
anil
Hi all
I need to append results from one table into other every week,So I want
to make sure that by mistake last weeks results(Already entered) are
not added again.
For that I have tried this query
SELECT tblImport.[SITE CODE], tblImport.[SAMPLE NO], tblImport.[REF
NO], tblImport.[SAMPLE DATE], tblImport.[PA NAME], tblImport.RESULT
FROM tblImport
WHERE (((tblImport.[SITE CODE]) not In (select Sitecode from qryIR))
AND ((tblImport.[SAMPLE NO]) not In (select labSampleNo from qryIR))
AND ((tblImport.[REF NO])Not In (select sampleID from qryIR)) AND
((tblImport.[SAMPLE DATE]) Not In (select sampletakenDate from qryIR))
AND ((tblImport.[ PA NAME]) not In (select ParameterName from qryIR))
AND ((tblImport.RESULT)Not In (select ResultValue from qryIR)));
Records from tblImport are appended in tblresults while matching the
sampleId from tblsample.
QryIR is join of tblResults and tblsample .Also in tblResults sample
No,Ref No,sample Date,PA Name and result can be many times so I need to
put trigger on all of these.
Since I am appending the results as well as updating the resultIsPass
In VBA.So I want to use code in VBA that only those results are
appended which are new and this week only to avoid any duplicacy.
can any one help me for using code like 'IF Exists' for these all
Field Values.I have tried but not sucessful.
Any other idea is appreciated.
thanks
anil
I need to append results from one table into other every week,So I want
to make sure that by mistake last weeks results(Already entered) are
not added again.
For that I have tried this query
SELECT tblImport.[SITE CODE], tblImport.[SAMPLE NO], tblImport.[REF
NO], tblImport.[SAMPLE DATE], tblImport.[PA NAME], tblImport.RESULT
FROM tblImport
WHERE (((tblImport.[SITE CODE]) not In (select Sitecode from qryIR))
AND ((tblImport.[SAMPLE NO]) not In (select labSampleNo from qryIR))
AND ((tblImport.[REF NO])Not In (select sampleID from qryIR)) AND
((tblImport.[SAMPLE DATE]) Not In (select sampletakenDate from qryIR))
AND ((tblImport.[ PA NAME]) not In (select ParameterName from qryIR))
AND ((tblImport.RESULT)Not In (select ResultValue from qryIR)));
Records from tblImport are appended in tblresults while matching the
sampleId from tblsample.
QryIR is join of tblResults and tblsample .Also in tblResults sample
No,Ref No,sample Date,PA Name and result can be many times so I need to
put trigger on all of these.
Since I am appending the results as well as updating the resultIsPass
In VBA.So I want to use code in VBA that only those results are
appended which are new and this week only to avoid any duplicacy.
can any one help me for using code like 'IF Exists' for these all
Field Values.I have tried but not sucessful.
Any other idea is appreciated.
thanks
anil