Using Access 97 I created a query that works. Then I took the SQL version of it and pasted it on a button but when I click the button nothing happens. What am I missing? Here is the code I have on the button:
Private Sub CmdRemove_City_of_Phx_from_Cost_Center_Field_Click()
Dim STRSOURCE As String
STRSOURCE = "UPDATE [SWG Import Test] SET [SWG Import Test].[Cost Center] = " & _
"IIf(Left([Cost Center],11)='City of Phx',Mid([Cost Center],13),[Cost Center]);"
end sub
Private Sub CmdRemove_City_of_Phx_from_Cost_Center_Field_Click()
Dim STRSOURCE As String
STRSOURCE = "UPDATE [SWG Import Test] SET [SWG Import Test].[Cost Center] = " & _
"IIf(Left([Cost Center],11)='City of Phx',Mid([Cost Center],13),[Cost Center]);"
end sub