Private Sub Text9_Change()
If Text9.Text <> "" Then
searchSQL = "select * from drv_temp_mid where 编号 like '%" & Trim(Text9.Text) & "%' or xm like '%" & Trim(Text9.Text) & "%' or sfzmhm like '%" & Trim(Text9.Text) & "%' or djzsxxdz like '%" & Trim(Text9.Text) & "%' or 备注 like '%" & Trim(Text9.Text) & "%' or zkcx like '%" & Trim(Text9.Text) & "%'"
End If
Adodc3.RecordSource = searchSQL
Adodc3.Refresh
order by 语句用了,界面打开时是按编号列排序了,可当Text9发生变化时就有回到原来的排序状态了。
比如access里有1-10个编号,我将6改成9,9改成6,(access里排序成123456789),界面打开时atagrid排序123456789,
可当我在Text9里输入1时,就有变成123459786了,好苦闷!