Vấn đề nằm ở đây
strSQL="select * from tblSubCategories"
strSQL=strSQL & "Where SubCateName=' " & Replace(name,"'","''") & "'"
Kết quả của chuỗi strSQL sau 2 câu lệnh này là
strSQL="select * from tblSubCategoriesWhere SubCateName=' " & Replace(name,"'","''") & "'"
Biết tại sao sai rồi chứ...