OR or AND

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I need to update an item and if there is an item with the subgroup +1,
update that as well. I'm using this and it sems to be working. Does
this update one or both, what is the logic?

DelMSql = "DELETE * FROM tblCheckDetailsTMP " & _
"WHERE tblCheckDetailsTMP.CDCheckID = Forms!frmFXVoidItem!TxtSalesID " & _
"AND tblCheckDetailsTMP.CDGroupID = Forms!frmFXVoidItem!TxtGroupID " & _
"AND tblCheckDetailsTMP.CDSubGroupID = Forms!frmFXVoidItem!TxtSubGroupID
" & _
"OR tblCheckDetailsTMP.CDCheckID = Forms!frmFXVoidItem!TxtSalesID " & _
"AND tblCheckDetailsTMP.CDGroupID = Forms!frmFXVoidItem!TxtGroupID " & _
"AND tblCheckDetailsTMP.CDSubGroupID =Forms!frmFXVoidItem!TxtSubGroupID +1;"
DoCmd.RunSQL (DelMSql)

Thanks
DS
 
That's a Delete query: it doesn't update, it deletes.

It will delete all rows that meet either of the criteria.
 
Douglas said:
That's a Delete query: it doesn't update, it deletes.

It will delete all rows that meet either of the criteria.
Sorry, Douglas. Not paying attention I should have posted the same thin
but as an Update Query. In either case it sounds like that it will do
as I need it.
DS
 
Back
Top