?? suprecord.frm
字號:
VERSION 5.00
Begin VB.Form supRecord
Caption = "處理報告"
ClientHeight = 7395
ClientLeft = 60
ClientTop = 345
ClientWidth = 7455
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
Moveable = 0 'False
ScaleHeight = 7395
ScaleWidth = 7455
StartUpPosition = 2 'CenterScreen
Begin VB.ComboBox Combo2
ForeColor = &H00FF0000&
Height = 420
Left = 1320
TabIndex = 21
Top = 1320
Width = 5775
End
Begin VB.ComboBox Combo1
ForeColor = &H00FF0000&
Height = 420
Left = 1320
TabIndex = 18
Top = 720
Width = 5775
End
Begin VB.CommandButton Command2
Caption = "關 閉"
Height = 375
Left = 5040
TabIndex = 17
Top = 6840
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "提 交"
Height = 375
Left = 1440
TabIndex = 16
Top = 6840
Width = 1215
End
Begin VB.TextBox Text7
ForeColor = &H00FF0000&
Height = 420
Left = 5280
TabIndex = 15
Top = 1920
Width = 1815
End
Begin VB.TextBox Text6
Height = 4095
Left = 360
MaxLength = 240
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 13
Top = 2520
Width = 6735
End
Begin VB.TextBox Text5
Alignment = 2 'Center
ForeColor = &H00FF0000&
Height = 375
Left = 6240
TabIndex = 5
Top = 120
Width = 495
End
Begin VB.TextBox Text4
Alignment = 2 'Center
ForeColor = &H00FF0000&
Height = 375
Left = 5160
TabIndex = 4
Top = 120
Width = 495
End
Begin VB.TextBox Text3
Alignment = 2 'Center
ForeColor = &H00FF0000&
Height = 375
Left = 4080
TabIndex = 3
Top = 120
Width = 495
End
Begin VB.TextBox Text2
Alignment = 2 'Center
ForeColor = &H00FF0000&
Height = 375
Left = 3000
TabIndex = 2
Top = 120
Width = 495
End
Begin VB.TextBox Text1
Alignment = 2 'Center
ForeColor = &H00FF0000&
Height = 375
Left = 1320
TabIndex = 1
Top = 120
Width = 1095
End
Begin VB.Label Label13
Caption = "故障摘要"
Height = 255
Left = 240
TabIndex = 20
Top = 1440
Width = 975
End
Begin VB.Label Label11
Caption = "(少于120字)"
ForeColor = &H00008000&
Height = 255
Left = 1320
TabIndex = 19
Top = 2040
Width = 1815
End
Begin VB.Label Label9
Caption = "報 告 人"
Height = 375
Left = 4200
TabIndex = 14
Top = 2040
Width = 975
End
Begin VB.Label Label8
Caption = "處理結果"
Height = 375
Left = 240
TabIndex = 12
Top = 2040
Width = 975
End
Begin VB.Label Label7
Caption = "客戶名稱"
Height = 255
Left = 240
TabIndex = 11
Top = 840
Width = 975
End
Begin VB.Label Label6
Caption = "分"
Height = 375
Left = 6960
TabIndex = 10
Top = 240
Width = 375
End
Begin VB.Label Label5
Caption = "時"
Height = 375
Left = 5880
TabIndex = 9
Top = 240
Width = 255
End
Begin VB.Label Label4
Caption = "日"
Height = 375
Left = 4680
TabIndex = 8
Top = 240
Width = 375
End
Begin VB.Label Label3
Caption = "月"
Height = 375
Left = 3720
TabIndex = 7
Top = 240
Width = 255
End
Begin VB.Label Label2
Caption = "年"
Height = 375
Left = 2640
TabIndex = 6
Top = 240
Width = 255
End
Begin VB.Label Label1
Caption = "報告時間"
Height = 255
Left = 240
TabIndex = 0
Top = 240
Width = 975
End
End
Attribute VB_Name = "supRecord"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Atract As String
Dim Duty As String
Dim Unit As String
Dim Content As String
Dim Rectime As String
Private Sub Command1_Click()
Rectime = Text1.Text + "-" + Text2.Text + "-" + Text3.Text + " " + Text4.Text + ":" + Text5.Text
If Len(Rectime) < 16 Then
rc = MsgBox("請輸入登錄時間!", vbOKOnly + vbExclamation, "輸入數據不完整")
Text1.SetFocus
Exit Sub
End If
If Combo1.Text <> "" Then
Unit = Combo1.Text
Else
rc = MsgBox("請選擇客戶名稱", vbOKOnly + vbExclamation, "輸入數據不完整")
Combo1.SetFocus
Exit Sub
End If
If Combo2.Text <> "" Then
Atract = Combo2.Text
Else
rc = MsgBox("請選擇故障摘要", vbOKOnly + vbExclamation, "輸入數據不完整")
Combo2.SetFocus
Exit Sub
End If
If Text6.Text = "" Or Text7.Text = "" Then
MsgBox "請在空格中填入數據!"
Exit Sub
End If
Content = Text6.Text
Duty = Text7.Text
Unit = Combo1.Text
Atract = Combo2.Text
rc = SQLAllocStmt(hdbc, hstmt)
If rc = SQL_ERROR Then
MsgBox "數據庫連接失敗。", vbCritical + vbOKOnly, "SQL出錯"
Unload Form1
End
End If
SQLstmt = "INSERT INTO suprecord VALUES ('" & Rectime & "','" & _
Unit & "','" & Atract & "','" & Duty & "','" & Content & "')"
rc = SQLExecDirect(hstmt, SQLstmt, SQL_NTS)
If rc <> SQL_ERROR Then
rc = MsgBox("以上數據已輸入數據庫中!", vbOKOnly + vbExclamation, "錄入成功")
Else: MsgBox "error", vbCritical, "unsuccess"
End If
rc = SQLFreeStmt(hstmt, SQL_DROP)
Combo1.Clear
Combo2.Clear
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Combo1.SetFocus
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Text1.Text = Year(Date)
Text2.Text = Month(Date)
If Len(Text2.Text) < 2 Then Text2.Text = "0" + Text2.Text
Text3.Text = Day(Date)
If Len(Text3.Text) < 2 Then Text3.Text = "0" + Text3.Text
Text4.Text = Hour(Time)
If Len(Text4.Text) < 2 Then Text4.Text = "0" + Text4.Text
Text5.Text = Minute(Time)
If Len(Text5.Text) < 2 Then Text5.Text = "0" + Text5.Text
RD2 = String(50, 0)
rc = SQLAllocStmt(hdbc, hstmt)
If rc = SQL_ERROR Then
MsgBox "數據庫連接失敗。", vbCritical + vbOKOnly, "SQL出錯"
Unload Form1
End
End If
SQLstmt = "SELECT partaname FROM prorecord"
rc = SQLExecDirect(hstmt, SQLstmt, SQL_NTS)
Do While SQLFetch(hstmt) <> SQL_NO_DATA_FOUND
rc = SQLGetData(hstmt, 1, SQL_C_CHAR, RD2, Len(RD2), SQL_NULL_DATA)
Combo1.additem RD2
Loop
rc = SQLFreeStmt(hstmt, SQL_DROP)
RD2 = String(50, 0)
rc = SQLAllocStmt(hdbc, hstmt)
SQLstmt = "SELECT atract FROM phonerecord"
rc = SQLExecDirect(hstmt, SQLstmt, SQL_NTS)
Do While SQLFetch(hstmt) <> SQL_NO_DATA_FOUND
rc = SQLGetData(hstmt, 1, SQL_C_CHAR, RD2, Len(RD2), SQL_NULL_DATA)
Combo2.additem RD2
Loop
rc = SQLFreeStmt(hstmt, SQL_DROP)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.Enabled = True
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -