以下是引用片段:
Private Sub btn添加_Click() '汉字同音检索算法 Dim i As Long If Me.Text2.Text = "" Then Exit Sub Dim strlike As String For i = 1 To Len(Me.Text2.Text) Dim tmprs As New ADODB.Recordset Set tmprs = ExecSql("select * from 汉字同音字典 where 同音 =( select 同音 from 汉字同音字典 where 汉字='" & Mid(Me.Text2.Text, i, 1) & "')") Dim str As String str = "" With tmprs Do Until .EOF str = str & " 人口名称 like '%" & .Fields("汉字").Value & "%' or" .MoveNext Loop End With strlike = strlike & str Next If Right(strlike, 2) = "or" Then strlike = Mid(strlike, 1, Len(strlike) - 2) End If Call UpdateList("where " & strlike) End Sub Private Sub Combo3_Click() '设置显示的不同模板的内容 Dim arrColwidth() arrColwidth = Array(0, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000) Dim i As Long For i = 0 To ddd.Cols - 1 ddd.ColWidth(i) = 0 Next Dim tmprs As New ADODB.Recordset Set tmprs = ExecSql("select * from 模版 where 模版名称='" & Me.Combo3.Text & "' ")
Dim ii As Long With tmprs Do Until .EOF For i = 0 To ddd.Cols - 1 If .Fields("表头内容").Value = ddd.TextMatrix(0, i) Then ddd.ColWidth(i) = arrColwidth(i) Exit For End If Next .MoveNext Loop End With End Sub Private Sub UserControl11_Click() '浏览检索 Dim strsql As String strsql = " where 1=1 " If Check1.Value = 1 Then strsql = strsql & " and 民族='" & Me.Combo2(8).Text & "'" End If If Check2.Value = 1 Then strsql = strsql & " and 户口状况='" & Me.Combo2(0).Text & "'" End If If Check3.Value = 1 Then strsql = strsql & " and 职业='" & Me.Combo2(2).Text & "'" End If If Check4.Value = 1 Then strsql = strsql & " and 文化程度='" & Me.Combo2(4).Text & "'" End If If Check5.Value = 1 Then strsql = strsql & " and 经济状况='" & Me.Combo2(6).Text & "'" End If
|