以下是引用片段:
实现功能的关键代码为: Private Sub Form_Load() '初始化信息 Me.Combozfzt.ListIndex = 0 Me.Combofh.ListIndex = 0 Call UpdateList(" ")
'获得相关报表模板 Me.Combobbmb.AddItem ("全部显示列") Dim tmprs As New ADODB.Recordset Dim i As Integer
Set tmprs = ExecSql("select * from bbmb where bbmc='" & "住房销售信息查询" & "'") With tmprs If .RecordCount > 0 Then For i = 1 To .RecordCount Me.Combobbmb.AddItem (.Fields("bbmbmc").Value) .MoveNext Next End If End With
Me.Combobbmb.ListIndex = 0 End Sub
Private Sub MMButton_XPBE1_Click(Index As Integer) '传递标志 调用住房详细信息窗体 If Trim(ddd.TextMatrix(ddd.Row, 1)) = "" Then Exit Sub frmZFXXXX.txtID.Text = Trim(ddd.TextMatrix(ddd.Row, 1)) frmZFXXXX.Show 1 End Sub
Private Sub MMButton_XPBE2_Click() '组合查询条件,查询符合条件的住房 Dim strwhere As String
If Trim(Me.txtsssq.Text) <> "" Then strwhere = strwhere + " and sqmc like '%" + Trim(Me.txtsssq.Text) + "%' " End If
If Trim(Me.txtssjmq.Text) <> "" Then strwhere = strwhere + " and jmqmc like '%" + Trim(Me.txtssjmq.Text) + "%' " End If
If Trim(Me.txtsshz.Text) <> "" Then strwhere = strwhere + " and hzxm like '%" + Trim(Me.txtsshz.Text) + "%' " End If
If Trim(Me.txtzfdm.Text) <> "" Then strwhere = strwhere + " and zfdm ='" + Trim(Me.txtzfdm.Text) + "' " End If
Select Case Me.Combozfzt.Text Case "全部住房" strwhere = strwhere + " and 1=1 " Case "已售住房" strwhere = strwhere + " and sjxsjg is not null and sjxsjg > 0 " Case "未售住房" strwhere = strwhere + " and (sjxsjg is null or sjxsjg = 0) " End Select
If Trim(Me.txtxsjg.Text) <> "" Then strwhere = strwhere + " and xsjg " + Me.Combofh.Text + Trim(Me.txtxsjg.Text) End If
Call UpdateList(strwhere) End Sub
Private Sub MMButton_XPBE3_Click() '导出报表 Call OutExcel(ddd, "住房销售信息列表") End Sub
|