I have a form with a checkbox. If the box is checked I want a table updated.
I have the below query, which works but I want to add a where clause and cant figure out where it fits it. Can someone please help with structure.
Private Sub RCSSub_AfterUpdate()
Dim dbs As Database
Dim qdf As QueryDef
Set dbs = CurrentDb()
If Me.RCSSub = "-1" Then _
dbs.Execute "Update (T1 inner join T2 on T1.Key = T2.Key) left join T3 on T1.key=T3.key " _
& "Set PrintLabel = ""-1"" ;"
Me.Requery
dbs.Close
End Sub
The where statement I want to add is:
"where T3.Key is null"
When in this should return all records from T1 that are also in T2 but not in T3.
thanks
I have the below query, which works but I want to add a where clause and cant figure out where it fits it. Can someone please help with structure.
Private Sub RCSSub_AfterUpdate()
Dim dbs As Database
Dim qdf As QueryDef
Set dbs = CurrentDb()
If Me.RCSSub = "-1" Then _
dbs.Execute "Update (T1 inner join T2 on T1.Key = T2.Key) left join T3 on T1.key=T3.key " _
& "Set PrintLabel = ""-1"" ;"
Me.Requery
dbs.Close
End Sub
The where statement I want to add is:
"where T3.Key is null"
When in this should return all records from T1 that are also in T2 but not in T3.
thanks