Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Comparing primary key in two separate tables.

Status
Not open for further replies.

socomfort

Technical User
Jul 8, 2005
46
US
Hello again:

I am attempting to compare two tables. One is a LookUP table and the other is a Temp table. Each contains an ActivityID.

The LookUp defaults are copied into the Temp table whenever a form is invoked. The user can then manipulate the defaults that are pulled in.

If a user deletes an activity and saves the record, that activity no longer exists in the underlying table. Is there a way to compare the table of defaults (tblLookUp) to the Temp table?

I thought perhaps I could use a variant...

Dim varInsert as Variant
varInsert = DLookup("ActivityID","tblLookUp","tblLookUp.ActivityID" <> "tblTemp").

Basically, I am looking for what is missing in tblTemp that exists in tblLookUp. IE, there are 23 activities and if a user deletes 2, I'd like to find the two that were deleted. I am wondering if I might also need a looping structure (a for loop perhaps?).

Anyway, any assistance you all can provide is much appreciated.
 
Under Query design would a 'Find Unmatched Query Wizard' do the trick?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top