Hi

The rmCode.Value should be a text vaule, but in the Set rs = cnn.Execute(SQL), the SQL become "select * from target where branch=TEXT". I need the SQL become to "select * from target where branch="TEXT"", otherwish it could not exe by SQL.

Please refer to below code for details.

Thank you!

-----------------------------------------------------------------------
SQL = "select * from target where branch= " & rmCode.Value & ""
Set rs = cnn.Execute(SQL)