试试这样..Dim UserInputData As StringUserInputData = "0602"sql = "Select * From 学籍表 Where 学号 Like '20" & Left(UserInputData, 2) & "______" & Right(UserInputData, 2) & "__'"
我倒..我只是举个例子...你用Text.Text去代替我的UserInputData不就行了吗?.