没看到1楼项目代码里有党龄在某某之间的用法,写了什么代码?
Dim sc As String
Dim str As String = e.Form.Controls("combobox3").Text
With e.Form.Controls("combobox1")
If .Value IsNot Nothing Then
If sc > "" Then
sc = sc & " And "
End If
sc = sc & "所属党组织= '" & .Value & "'"
End If
End With
With e.Form.Controls("combobox2")
If .Value IsNot Nothing Then
If sc > "" Then
sc = sc & " And "
End If
sc = sc & "在册状态 = '" & .Value & "'"
End If
End With
With e.Form.Controls("num1")
If .Value IsNot Nothing Then
If sc > "" Then
sc = sc & " And "
End If
sc = sc & "党龄" & str& '" & .Value & "'"
End If
End With
With e.Form.Controls("num1")
If .Value IsNot Nothing Then
If sc > "" Then
sc = sc & " And "
End If
sc = sc & "党龄" & str& '" & .Value & "'"
End If
End With
If sc > "" Then
Tables("testt_table1").Filter = sc
'forms("main").Controls("label50").text = "第" & (Tables("报表管理_table1").Position + 1) & "行,共" & Tables("报表管理_table1").Rows.Count & "行"
Tables("testt_table1").Focus
Else
' e.Form.Controls("label50").Text = "请输入查询条件!"
MessageBox.Show("请输入查询条件")
End If
就是两个党龄语句
[此贴子已经被作者于2024/9/11 20:41:25编辑过]
With e.Form.Controls("num1")
If .Value IsNot Nothing Then
If sc > "" Then
sc = sc & " And "
End If
sc = sc & "党龄" & str& '" & .Value & "'"
End If
End With
With e.Form.Controls("num1") '''指向是同一个控件
If .Value IsNot Nothing Then
If sc > "" Then
sc = sc & " And "
End If
sc = sc & "党龄" & str& '" & .Value & "'"
End If
End With