Searching string for value of another field

rwttm001

New member
Local time
Today, 22:27
Joined
Nov 20, 2002
Messages
7
Hi

Sorry to be vague in the subject - quite difficult to word this one!

I have 2 tables in my db, & I need a piece of code to search in the field Subject in tblImportMessages for a unique value (NewEmployeeID) that has been embedded earlier , then to turn a yes/no field to yes in the corresponding NewemployeeID field in tblEmployee.

e.g *2* in Subject in tblImportMessages would check the yes/no field in tblEmployee where NewEmployeeID = 2.

Thanks

MWR
 
You want to update the records in the employee table where the employee is in the import table. There are two easy ways:

Code method - Open two recordsets, for all the unique records from the import table find the matching record in the employee recordset and update the appropriate flag.

Query Method - Create a query that will only return the unique NewEmpID. Copy that sql (you won't need to save this query after you are done). Create an update query and bring in two fields - your employeeID and the flag you want to update. Put the below line in the criteria of the employeeID....

IN (paste your sql statement here)

It may look like this...

IN (Select DistinctRow NewEmpID From tblImportMessages)

That should work fine.
 

Users who are viewing this thread

Back
Top Bottom