以下是引用片段:
其主要代码实现如下: Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Index Case 1 If Me.Text1(2).Text = "" Or Me.Text1(5).Text = "" Or Me.Text1(7).Text = "" Then MsgBox "客户名称 所属区域或所属房型不能为空" Exit Sub End If '根据标志 添加或修改购房客户信息 If frmMain.Tag = "" Then Call SetSql("insert into 客户登记(登记日期,接待人员,客户名称,联系手机,固定电话,区域编号,意向楼层, " _ & " 房型编号,最小建筑面积,意向总价,付款方式,装修情况) values('" & Me.DTPicker1.Value & "','" & Me.Text1(1).Text & "', " _ & " '" & Me.Text1(2).Text & "','" & Me.Text1(6).Text & "','" & Me.Text1(4).Text & "', " _ & " " & Me.Text1(5).Tag & ",'" & Me.Combo1.Text & "'," & Me.Text1(7).Tag & ", " _ & " '" & Me.Text1(0).Text & "','" & Me.Text1(10).Text & "','" & Me.Combo5.Text & "','" & Me.Combo2.Text & "')") Else Call SetSql("update 客户登记 set 登记日期='" & Me.DTPicker1.Value & "', " _ & " 接待人员='" & Me.Text1(1).Text & "',客户名称='" & Me.Text1(2).Text & "'," _ & " 联系手机='" & Me.Text1(6).Text & "',固定电话='" & Me.Text1(4).Text & "', " _ & " 区域编号=" & Me.Text1(5).Tag & ",意向楼层='" & Me.Combo1.Text & "'," _ & " 房型编号=" & Me.Text1(7).Tag & ",最小建筑面积='" & Me.Text1(0).Text & "'," _ & " 意向总价='" & Me.Text1(10).Text & "',付款方式='" & Me.Combo5.Text & "', " _ & " 装修情况='" & Me.Combo2.Text & "' where 客户登记编号=" & frmMain.Tag) End If Case 2 '删除当前购房客户信息 If GetSql("select * from 看房记录 where 客户登记编号=" & frmMain.Tag).RecordCount > 0 Then MsgBox "此客户存在使用的信息,不能删除" Exit Sub End If If GetSql("select * from 购房登记 where 客户登记编号=" & frmMain.Tag).RecordCount > 0 Then MsgBox "此客户存在使用的信息,不能删除" Exit Sub End If Call SetSql("delete from 客户登记 where 客户登记编号=" & frmMain.Tag) Case 3 End Select Unload Me Call frmGfkhList.initTable End Sub
|