dim nm as string = e.Form.Controls("ComboBox1").Value '获取列名 Dim vl as string = e.Form.Controls("TextBox1").Value '获取查询内容 Dim Filter As string ‘查询条件变量 Dim sp as string if DataTables("表名").DataCols(nm).IsDate then sp = "#" elseif DataTables("表名").DataCols(nm).IsString then sp = "'" End if Filter = nm & " = " & sp & vl & sp .....