I am stumped. I am trying to use a SQL statement in VBA to replace part of a field in a table. It works great when I use the SQL statement when building an Update Query, but I keep getting errors when I use it in VBA (mostly Runtime 3075).
Here is the SQL statement I want to use...
The idea is to replace "p" number in a URL with a new number (strP). Here is a sample URL...
http://stockcharts.com/h-sc/ui?s=A&p=D&b=5& g=0&id=p29873932357&a=44529210&lis tNum=127
I want to replace the bolded text.
I can use RegEx if I loop through each record of the table, but it would be much faster and easier using an Update statement.
Thoughts?
Here is the SQL statement I want to use...
Code:
strSQL = "UPDATE tblSymbols SET tblSymbols.StockchartsLink = '" & Left("StockchartsLink", InStr(1, "StockchartsLink", "=p") + 1) & strP & Mid("StockchartsLink", InStr(1, "StockchartsLink", "=p") + 12, 50) & "' WHERE ((StockchartsLink <>''))"
http://stockcharts.com/h-sc/ui?s=A&p=D&b=5& g=0&id=p29873932357&a=44529210&lis tNum=127
I want to replace the bolded text.
I can use RegEx if I loop through each record of the table, but it would be much faster and easier using an Update statement.
Thoughts?
Comment