I need help writing an UPDATE query. Here is some background:
tblA has fields ID_A (integer), YN (boolean), etc..
25 -1
26 0
... etc ...
tblB has 12 fields ID_B ID1 ID2 ID3 ID4 ID5...
2 12 25 31 46 60....
3 10 12 19 26 28....
26 14 16 31 32 47....
... etc ...
If tblA.ID_A = 26, for example, I want to set the value of YN to NOT YN (ie, -1), for all records where tblA.ID_A = 14 or 16 or 31 or 32 or 47 or ... (values from tblB).
I've been trying something like...
strUpDate = "UPDATE tblA SET YN = NOT " & YN & " WHERE tblA.ID IN (" ???????? ")"
CurrentDb.Execute strUpDate
I can't get the ????? part, and I'm not even sure this is the best approach. Any ideas how to do this properly are appreciated.
Teach314
tblA has fields ID_A (integer), YN (boolean), etc..
25 -1
26 0
... etc ...
tblB has 12 fields ID_B ID1 ID2 ID3 ID4 ID5...
2 12 25 31 46 60....
3 10 12 19 26 28....
26 14 16 31 32 47....
... etc ...
If tblA.ID_A = 26, for example, I want to set the value of YN to NOT YN (ie, -1), for all records where tblA.ID_A = 14 or 16 or 31 or 32 or 47 or ... (values from tblB).
I've been trying something like...
strUpDate = "UPDATE tblA SET YN = NOT " & YN & " WHERE tblA.ID IN (" ???????? ")"
CurrentDb.Execute strUpDate
I can't get the ????? part, and I'm not even sure this is the best approach. Any ideas how to do this properly are appreciated.
Teach314