?? formhf.frm
字號:
VERSION 5.00
Begin VB.Form FormHF
BorderStyle = 1 'Fixed Single
Caption = "Form1"
ClientHeight = 4830
ClientLeft = 45
ClientTop = 435
ClientWidth = 6585
BeginProperty Font
Name = "Tahoma"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4830
ScaleWidth = 6585
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdXG
Caption = "修改(&E)"
Height = 340
Left = 1080
TabIndex = 20
Top = 4320
Width = 1215
End
Begin VB.CommandButton cmdDEL
Caption = "刪除(&D)"
Height = 340
Left = 2400
TabIndex = 19
Top = 4320
Width = 1215
End
Begin VB.CommandButton cmdBC
Caption = "保存(&S)"
Height = 340
Left = 3720
TabIndex = 18
Top = 4320
Width = 1215
End
Begin VB.CommandButton cmdEXIT
Caption = "退出(&X)"
Height = 340
Left = 5040
TabIndex = 17
Top = 4320
Width = 1215
End
Begin VB.ComboBox comFWPJ
Height = 330
Left = 4560
TabIndex = 4
Top = 3240
Width = 1695
End
Begin VB.ComboBox comCPPJ
Height = 330
Left = 1320
TabIndex = 3
Top = 3240
Width = 1695
End
Begin VB.TextBox txtHFRQ
Height = 315
Left = 4560
TabIndex = 6
Top = 3720
Width = 1695
End
Begin VB.TextBox txtHFR
Height = 315
Left = 1320
MaxLength = 15
TabIndex = 5
Top = 3720
Width = 1695
End
Begin VB.TextBox txtYHJY
Height = 975
Left = 1320
MultiLine = -1 'True
TabIndex = 2
Top = 2160
Width = 4935
End
Begin VB.TextBox txtSYQK
Height = 975
Left = 1320
MultiLine = -1 'True
TabIndex = 1
Top = 1080
Width = 4935
End
Begin VB.TextBox txtHFID
Enabled = 0 'False
Height = 315
Left = 1320
TabIndex = 9
Top = 600
Width = 1695
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H8000000D&
BorderStyle = 0 'None
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 375
Left = 0
ScaleHeight = 375
ScaleWidth = 9135
TabIndex = 0
Top = 0
Width = 9135
Begin VB.Label Label11
BackStyle = 0 'Transparent
Caption = "回訪記錄"
BeginProperty Font
Name = "Tahoma"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 375
Left = 240
TabIndex = 7
Top = 45
Width = 1095
End
Begin VB.Label Label10
BackStyle = 0 'Transparent
Caption = "回訪記錄"
BeginProperty Font
Name = "Tahoma"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 375
Left = 240
TabIndex = 8
Top = 75
Width = 1335
End
End
Begin VB.Label Label7
Caption = "回訪日期"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3600
TabIndex = 16
Top = 3795
Width = 855
End
Begin VB.Label Label6
Caption = "回 訪 人"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 15
Top = 3765
Width = 735
End
Begin VB.Label Label5
Caption = "服務評價"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3600
TabIndex = 14
Top = 3315
Width = 735
End
Begin VB.Label Label4
Caption = "產品評價"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 13
Top = 3315
Width = 735
End
Begin VB.Label Label3
Caption = "用戶建議"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 360
TabIndex = 12
Top = 2325
Width = 855
End
Begin VB.Label Label2
Caption = "使用情況"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 345
TabIndex = 11
Top = 1230
Width = 735
End
Begin VB.Label Label1
Caption = "回訪單號"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 360
TabIndex = 10
Top = 675
Width = 735
End
End
Attribute VB_Name = "FormHF"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub hfzdbh()
'自動編號~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Call OpenConn
sql = "select hfid from hfb ORDER BY hfid"
rs.Open sql, cn, 1, 1
If rs.RecordCount > 0 Then
rs.MoveLast
txtHFID.Text = "HF" & Format(Val(Right(rs.Fields("hfid"), 5) + 1), "00000")
Else
txtHFID.Text = "HF00001"
End If
Call CloseConn
End Sub
Private Sub cmdBC_Click()
'非空校驗~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
If txtHFID.Text = "" Then
MsgBox "回訪單號不能為空!", 48, "錯誤提示"
Exit Sub
End If
If txtSYQK.Text = "" Then
MsgBox "用戶使用情況不能為空!", 48, "錯誤提示"
txtSYQK.SetFocus
Exit Sub
End If
If comCPPJ.Text = "" Then
MsgBox "產品評價不能為空!", 48, "錯誤提示"
comCPPJ.SetFocus
Exit Sub
End If
If comFWPJ.Text = "" Then
MsgBox "服務評價不能為空!", 48, "錯誤提示"
comFWPJ.SetFocus
Exit Sub
End If
If txtHFR.Text = "" Then
MsgBox "回訪人不能為空!", 48, "錯誤提示"
txtHFR.SetFocus
Exit Sub
End If
If txtHFRQ.Text = "" Then
MsgBox "回訪日期不能為空!", 48, "錯誤提示"
txtHFRQ.SetFocus
Exit Sub
End If
Call OpenConn
sql = "select * from hfb"
rs.Open sql, cn, 3, 3
rs.AddNew
rs.Fields("hfid") = txtHFID.Text
rs.Fields("syqk") = txtSYQK.Text
rs.Fields("yhjy") = txtYHJY.Text
rs.Fields("cppj") = comCPPJ.Text
rs.Fields("fwpj") = comFWPJ.Text
rs.Fields("hfr") = txtHFR.Text
rs.Fields("hfrq") = txtHFRQ.Text
rs.Fields("hyhid") = yhxhcd
rs.Update
Call CloseConn
MsgBox "添加成功!", 64, "操作成功"
FormYHXX.Command2 = True
Unload Me
End Sub
Private Sub cmdDEL_Click()
If MsgBox("是否要刪除該回訪記錄?", 48 + vbYesNo, "操作提示") = vbNo Then
Exit Sub
End If
Call OpenConn
sql = "select * from hfb where hfid='" & hfidcd & "'"
rs.Open sql, cn, 3, 3
rs.Delete
Call CloseConn
MsgBox "刪除成功!", 64, "操作成功"
FormYHXX.Command2 = True
Unload Me
End Sub
Private Sub cmdEXIT_Click()
Unload Me
End Sub
Private Sub cmdXG_Click()
'非空校驗~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
If txtHFID.Text = "" Then
MsgBox "回訪單號不能為空!", 48, "錯誤提示"
Exit Sub
End If
If txtSYQK.Text = "" Then
MsgBox "用戶使用情況不能為空!", 48, "錯誤提示"
txtSYQK.SetFocus
Exit Sub
End If
If comCPPJ.Text = "" Then
MsgBox "產品評價不能為空!", 48, "錯誤提示"
comCPPJ.SetFocus
Exit Sub
End If
If comFWPJ.Text = "" Then
MsgBox "服務評價不能為空!", 48, "錯誤提示"
comFWPJ.SetFocus
Exit Sub
End If
If txtHFR.Text = "" Then
MsgBox "回訪人不能為空!", 48, "錯誤提示"
txtHFR.SetFocus
Exit Sub
End If
If txtHFRQ.Text = "" Then
MsgBox "回訪日期不能為空!", 48, "錯誤提示"
txtHFRQ.SetFocus
Exit Sub
End If
Call OpenConn
sql = "select * from hfb where hfid='" & hfidcd & "'"
rs.Open sql, cn, 3, 3
rs.Fields("hfid") = txtHFID.Text
rs.Fields("syqk") = txtSYQK.Text
rs.Fields("yhjy") = txtYHJY.Text
rs.Fields("cppj") = comCPPJ.Text
rs.Fields("fwpj") = comFWPJ.Text
rs.Fields("hfr") = txtHFR.Text
rs.Fields("hfrq") = txtHFRQ.Text
rs.Fields("hyhid") = yhxhcd
rs.Update
Call CloseConn
MsgBox "修改成功!", 64, "操作成功"
FormYHXX.Command2 = True
End Sub
Private Sub Form_Load()
Me.Icon = FormZY.Icon
Me.Caption = xtmc
If hfidcd = "" Then '判斷來源~~~~~~~~~`
comCPPJ.AddItem "很滿意"
comCPPJ.AddItem "滿 意"
comCPPJ.AddItem "不滿意"
comFWPJ.AddItem "很滿意"
comFWPJ.AddItem "滿 意"
comFWPJ.AddItem "不滿意"
cmdXG.Visible = False
cmdDEL.Visible = False
Call hfzdbh '自動編號
txtHFRQ.Text = Format(Date, yyyymmdd)
txtHFR.Text = czy
Exit Sub
End If
cmdBC.Visible = False
comCPPJ.AddItem "很滿意"
comCPPJ.AddItem "滿 意"
comCPPJ.AddItem "不滿意"
comFWPJ.AddItem "很滿意"
comFWPJ.AddItem "滿 意"
comFWPJ.AddItem "不滿意"
If czyqx = "業務員" Then '判斷權限~~~~~~~~~~~~~~~~~~~~~~~~
cmdXG.Visible = False
cmdDEL.Visible = False
End If
Call OpenConn
sql = "select * from hfb where hfid='" & hfidcd & "'"
rs.Open sql, cn, 1, 1
txtHFID.Text = rs.Fields("hfid")
txtSYQK.Text = rs.Fields("syqk")
txtYHJY.Text = rs.Fields("yhjy")
comCPPJ.Text = rs.Fields("cppj")
comFWPJ.Text = rs.Fields("fwpj")
txtHFR.Text = rs.Fields("hfr")
txtHFRQ.Text = rs.Fields("hfrq")
Call CloseConn
End Sub
Private Sub txtHFRQ_LostFocus()
'~~~~~~~~~~日期格式~~~~~~~~~~~~~~~~
If IsDate(txtHFRQ.Text) Then
txtHFRQ = Format(txtHFRQ.Text, "yyyy-mm-dd")
Else
txtHFRQ = ""
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -