📄 frm_khtkdgl.frm
字号:
frm_jbry.Height = 2790
frm_jbry.Width = 3825
frm_jbry.Left = 3800
frm_jbry.Top = 2200
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
MDI_main.Toolbar1.Visible = True
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If Toolbar1.Buttons(1).Enabled = False Then
Adodc1.RecordSource = "select * from Table_KHTK where 退款单号='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Text1.Text = Adodc1.Recordset.Fields("退款单号")
DTPicker1.Value = Adodc1.Recordset.Fields("退款日期")
Text2.Text = Adodc1.Recordset.Fields("客户名称")
Text3.Text = Adodc1.Recordset.Fields("客户编号")
Combo1.Text = Adodc1.Recordset.Fields("性别")
Text4.Text = Adodc1.Recordset.Fields("年龄")
Text6.Text = Adodc1.Recordset.Fields("工作单位")
Text7.Text = Adodc1.Recordset.Fields("联系地址")
Text8.Text = Adodc1.Recordset.Fields("身份证")
Text9.Text = Adodc1.Recordset.Fields("联系电话")
Text10.Text = Adodc1.Recordset.Fields("经办人员")
Text11.Text = Adodc1.Recordset.Fields("人员编号")
Text12.Text = Adodc1.Recordset.Fields("退款金额")
Text13.Text = Adodc1.Recordset.Fields("退款原因")
Else
End If
Else
End If
Else
End If
End Sub
Private Sub Text10_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
frm_jbry.Show
frm_jbry.Height = 2790
frm_jbry.Width = 3825
frm_jbry.Left = 3800
frm_jbry.Top = 2200
Else
End If
End Sub
Private Sub Text12_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Dim StrInput, temp As String
Dim i, Length As Integer
i = 1
StrInput = Text12.Text
Length = Len(StrInput)
If Text12.Text = "" Then
MsgBox "输入不能为空", , "提示"
Text12.SetFocus
Else
Do While (i <= Length)
temp = Mid$(StrInput, i, 1)
If Asc(temp) < 48 Or Asc(temp) > 57 Then
If i = 1 Then
MsgBox "输入数据非法!!", , "提示"
Else
End If
Text12.Text = ""
Text12.SetFocus
Else
End If
i = i + 1
Loop
If Text12.Text = "" Then
Text12.SetFocus
Else
Text13.SetFocus
End If
End If
Else
End If
End Sub
Private Sub Text13_KeyDown(KeyCode As Integer, Shift As Integer)
Set adoCon = New ADODB.Connection
adoCon.Open "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=ljm"
If KeyCode = 13 Then
If Text2.Text = "" Then
MsgBox "请您选择退款用户名称", 48, "房地产销售管理系统"
ElseIf Text10.Text = "" Then
MsgBox "请您经办人员名称", 48, "房地产销售管理系统"
ElseIf Text12.Text = "" Then
MsgBox "请输入退款紧额", 48, "房地产销售管理系统"
ElseIf Text13.Text = "" Then
MsgBox "请输入退款原因", 48, "房地产销售管理系统"
Else
If Text2.Text <> "" Then
Adodc1.RecordSource = "select * from Table_KHTK"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveLast
Text1.Text = Adodc1.Recordset.Fields("退款单号")
Text1.Text = Val(Text1.Text) + 1
Else
Text1.Text = 10000
End If
Set adoRs = adoCon.Execute("insert into Table_KHTK values(" & Text1 & ",'" & DTPicker1 & "','" & Text2 & "','" & Text3 & "','" & Combo1 & "','" & Text4 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "','" & Text12 & "','" & Text10 & "','" & Text11 & "','" & Text13 & "')")
Adodc1.Refresh
MsgBox "数据保存成功!!", , "房地产销售管理系统"
Data_KHTKD.Label14.Caption = frm_YHZC.Text6.Text + "房地产销售管理系统"
Data_KHTKD.Text11.Text = Now
Data_KHTKD.Text1.Text = Text1.Text
Data_KHTKD.Text2.Text = Text2.Text
Data_KHTKD.Text3.Text = Text3.Text
Data_KHTKD.Text4.Text = Text4.Text
Data_KHTKD.Text6.Text = Text6.Text
Data_KHTKD.Text7.Text = Text7.Text
Data_KHTKD.Text8.Text = Text8.Text
Data_KHTKD.Text9.Text = Text9.Text
Data_KHTKD.Text10.Text = Text10.Text
Data_KHTKD.Text12.Text = Text12.Text
Data_KHTKD.Text13.Text = Text13.Text
Data_KHTKD.Text14.Text = Combo1.Text
Data_KHTKD.Text5.Text = DTPicker1.Value
i = MsgBox("确认打印吗?", 33, "房地产销售管理系统")
If i = vbOK Then
Data_KHTKD.PrintForm
Else
End If
Else
End If
End If
Else
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
frm_tkkh.Show
frm_tkkh.Left = 1050
frm_tkkh.Top = 1600
Else
End If
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
Set adoCon = New ADODB.Connection
adoCon.Open "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=ljm"
Select Case Button.Index
Case 1
Command1.Enabled = True
Toolbar1.Buttons(1).Enabled = True
Toolbar1.Buttons(2).Enabled = False
Toolbar1.Buttons(3).Enabled = False
Toolbar1.Buttons(4).Enabled = True
Toolbar1.Buttons(5).Enabled = True
Toolbar1.Buttons(6).Enabled = True
Toolbar1.Buttons(7).Enabled = True
Toolbar1.Buttons(8).Enabled = True
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text2.SetFocus
Case 2
Toolbar1.Buttons(1).Enabled = False
Toolbar1.Buttons(2).Enabled = True
Toolbar1.Buttons(3).Enabled = False
Toolbar1.Buttons(4).Enabled = True
Toolbar1.Buttons(5).Enabled = True
Toolbar1.Buttons(6).Enabled = True
Toolbar1.Buttons(7).Enabled = True
Toolbar1.Buttons(8).Enabled = True
Case 3
If Adodc1.Recordset.EOF = False Then
c = MsgBox("您确认要删除该记录吗?", 17, "房地产销售管理系统")
If c = vbOK Then
Adodc1.Recordset.Delete
Adodc1.Refresh
Else
End If
Else
MsgBox "当前数据库中已经无记录可删除!!", 32, "房地产销售管理系统"
End If
Case 4
If Text2.Text <> "" Then
If Toolbar1.Buttons(1).Enabled = True Then
Adodc1.RecordSource = "select * from Table_KHTK order by 退款单号"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveLast
Text1.Text = Adodc1.Recordset.Fields("退款单号")
Text1.Text = Val(Text1.Text) + 1
Else
Text1.Text = 10000
End If
Set adoRs = adoCon.Execute("insert into Table_KHTK values(" & Text1 & ",'" & DTPicker1 & "','" & Text2 & "','" & Text3 & "','" & Combo1 & "','" & Text4 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "','" & Text12 & "','" & Text10 & "','" & Text11 & "','" & Text13 & "')")
MsgBox "数据保存成功!!", , "房地产销售管理系统"
Adodc1.Refresh
frm_tkkh.Adodc1.Refresh
Toolbar1.Buttons(1).Enabled = True
Toolbar1.Buttons(2).Enabled = True
Toolbar1.Buttons(3).Enabled = True
Toolbar1.Buttons(4).Enabled = False
Toolbar1.Buttons(5).Enabled = False
Toolbar1.Buttons(6).Enabled = True
Toolbar1.Buttons(7).Enabled = True
Toolbar1.Buttons(8).Enabled = True
ElseIf Toolbar1.Buttons(1).Enabled = False Then
If Adodc1.Recordset.EOF = False Then
Adodc1.Recordset.Delete
Adodc1.Refresh
' Adodc1.RecordSource = "select * from Table_KHTK"
' Adodc1.Refresh
' If Adodc1.Recordset.RecordCount > 0 Then
' Adodc1.Recordset.MoveLast
' Text1.Text = Adodc1.Recordset.Fields("退款单号")
' Text1.Text = Val(Text1.Text) + 1
' Else
' Text1.Text = 10000
' End If
If Text1.Text = "" Then
MsgBox "请您输入退款单号"
Else
Set adoRs = adoCon.Execute("insert into Table_KHTK values(" & Text1 & ",'" & DTPicker1 & "','" & Text2 & "','" & Text3 & "','" & Combo1 & "','" & Text4 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "','" & Text12 & "','" & Text10 & "','" & Text11 & "','" & Text13 & "')")
MsgBox "数据修改成功!!", , "房地产销售管理系统"
End If
Else
' Adodc1.RecordSource = "select * from Table_KHTK"
' Adodc1.Refresh
' If Adodc1.Recordset.RecordCount > 0 Then
' Adodc1.Recordset.MoveLast
' Text1.Text = Adodc1.Recordset.Fields("退款单号")
' Text1.Text = Val(Text1.Text) + 1
' Else
' Text1.Text = 10000
' End If
Data_KHTKD.Label14.Caption = frm_YHZC.Text6.Text + "房地产销售管理系统"
Data_KHTKD.Text11.Text = Now
' Set adoRs = adoCon.Execute("insert into Table_KHTK values(" & Text1 & ",'" & DTPicker1 & "','" & Text2 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "','" & Text10 & "','" & Text11 & "','" & Text12 & "','" & Text13 & "')")
' MsgBox "数据保存成功!!", , "房地产销售管理系统"
End If
Adodc1.RecordSource = "select * from Table_KHTK "
Adodc1.Refresh
Toolbar1.Buttons(1).Enabled = True
Toolbar1.Buttons(2).Enabled = True
Toolbar1.Buttons(3).Enabled = True
Toolbar1.Buttons(4).Enabled = False
Toolbar1.Buttons(5).Enabled = False
Toolbar1.Buttons(6).Enabled = True
Toolbar1.Buttons(7).Enabled = True
Toolbar1.Buttons(8).Enabled = True
Else
End If
Else
End If
Adodc1.RecordSource = "select * from Table_KHTK order by 退款单号"
Adodc1.Refresh
Case 5
Adodc1.RecordSource = "select * from Table_KHTK "
Adodc1.Refresh
Toolbar1.Buttons(1).Enabled = True
Toolbar1.Buttons(2).Enabled = True
Toolbar1.Buttons(3).Enabled = True
Toolbar1.Buttons(4).Enabled = False
Toolbar1.Buttons(5).Enabled = False
Toolbar1.Buttons(6).Enabled = True
Toolbar1.Buttons(7).Enabled = False
Toolbar1.Buttons(8).Enabled = True
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text1.SetFocus
Case 6
frm_KHTKCX.Height = 7155
frm_KHTKCX.Width = 11040
frm_KHTKCX.Left = 400
frm_KHTKCX.Top = 230
frm_KHTKCX.Show
Case 7
i = MsgBox("确认打印吗?", 33, "房地产销售管理系统")
If i = vbOK Then
Data_KHTKD.Text1 = Text1.Text
Data_KHTKD.Text2 = Text2.Text
Data_KHTKD.Text3 = Text3.Text
Data_KHTKD.Text4 = Text4.Text
Data_KHTKD.Text6 = Text6.Text
Data_KHTKD.Text7 = Text7.Text
Data_KHTKD.Text8 = Text8.Text
Data_KHTKD.Text14 = Combo1.Text
Data_KHTKD.Text5 = DTPicker1.Value
Data_KHTKD.Text9 = Text9.Text
Data_KHTKD.Text10 = Text10.Text
Data_KHTKD.Text12 = Text12.Text
Data_KHTKD.Text13 = Text13.Text
Data_KHTKD.PrintForm
Else
End If
Case 8
Unload Me
MDI_main.Toolbar1.Visible = True
End Select
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -