Private Sub cmdQurey_Click () Dim strQuery As String StrQuery="Select * from Taoziyuan where 1=1" If txtzhuose. Text & lt;> "" Then StrQuery=strQuery & amp; "And" & amp; Txtzhuose. Text & amp; "Is not full" End the If Adodc1. RecordSource=strQuery Adodc1. Refresh The Exit Sub Errhandler: MsgBox "error number:" & amp; Err. Number & amp; "Error message:" & amp; Err, Description, vbExclamatio End Sub
CodePudding user response:
The data refresh time wrong!
CodePudding user response:
What wrong all don't say I guess, I guess, I guess: Address if txtzhuose importer string is Then spell good SQL statement is
Select * from Taoziyuan where 1=1 and address is not full
1. and no Spaces before and after2. Address (txtzhuose. Text) no Spaces before and after the 3. full are you sure they aren't null ?
CodePudding user response:
StrQuery=strQuery & amp; This sentence is wrong? I want more query conditions, how to write a statement?