The following code runs without errors but also does not update the table correctly. If I take the values of the 3 variables below and plug them into the SQl, it works correctly and makes the updates. How do you reference variable? I went through Access Help but could not find my mistake below.
bName = "American"
criteria1 = "*Test*"
criteria2 = "Longhorn"
strSQL = "UPDATE [New_Items] SET [New_Items].segment = "" & criteria2 & "" " & _
"WHERE (((New_Items.[Desc]) Like "" & criteria1 & "") AND ((New_Items.Brand) = "" & bName & "")) "
DoCmd.RunSQL strSQL
If you need me to post the code that does work let me know. Its basically the same as above except the ' & variable &' are replaced with the actual values.
Thanks as always,
Marco
bName = "American"
criteria1 = "*Test*"
criteria2 = "Longhorn"
strSQL = "UPDATE [New_Items] SET [New_Items].segment = "" & criteria2 & "" " & _
"WHERE (((New_Items.[Desc]) Like "" & criteria1 & "") AND ((New_Items.Brand) = "" & bName & "")) "
DoCmd.RunSQL strSQL
If you need me to post the code that does work let me know. Its basically the same as above except the ' & variable &' are replaced with the actual values.
Thanks as always,
Marco