?? 住戶報(bào)修管理.frm
字號:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Form5
Caption = "住戶報(bào)修管理"
ClientHeight = 7245
ClientLeft = 2865
ClientTop = 3015
ClientWidth = 10440
Icon = "住戶報(bào)修管理.frx":0000
LinkTopic = "Form5"
MDIChild = -1 'True
ScaleHeight = 7245
ScaleWidth = 10440
Begin VB.Frame Frame2
Height = 2895
Left = 240
TabIndex = 23
Top = 4200
Width = 9975
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Bindings = "住戶報(bào)修管理.frx":08CA
Height = 2535
Left = 120
TabIndex = 24
Top = 240
Width = 9735
_ExtentX = 17171
_ExtentY = 4471
_Version = 393216
BackColor = 12648447
BackColorFixed = 16777215
BackColorBkg = 12640511
End
End
Begin VB.Frame Frame1
Height = 3855
Left = 240
TabIndex = 0
Top = 240
Width = 9975
Begin VB.CommandButton Command5
Caption = "查 找"
Height = 375
Left = 8040
TabIndex = 25
Top = 2760
Width = 1335
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "D:\zj\db.mdb"
DefaultCursorType= 0 '缺省游標(biāo)
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 7800
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "住戶報(bào)修管理"
Top = 3120
Visible = 0 'False
Width = 1815
End
Begin VB.CommandButton Command4
Caption = "下一條"
Height = 375
Left = 8040
TabIndex = 22
Top = 2160
Width = 1335
End
Begin VB.CommandButton Command3
Caption = "上一條"
Height = 375
Left = 8040
TabIndex = 21
Top = 1560
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "刪 除"
Height = 375
Left = 8040
TabIndex = 20
Top = 960
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "添 加"
Height = 375
Left = 8040
TabIndex = 19
Top = 360
Width = 1335
End
Begin VB.TextBox Text9
BackColor = &H00C0FFFF&
DataField = "報(bào)修內(nèi)容"
DataSource = "Data1"
Height = 615
Left = 1440
TabIndex = 18
Top = 2880
Width = 5655
End
Begin VB.TextBox Text8
BackColor = &H00C0FFFF&
DataField = "物料費(fèi)用"
DataSource = "Data1"
Height = 270
Left = 5160
TabIndex = 17
Top = 2240
Width = 1935
End
Begin VB.TextBox Text7
BackColor = &H00C0FFFF&
DataField = "維修費(fèi)用"
DataSource = "Data1"
Height = 270
Left = 1440
TabIndex = 16
Top = 2240
Width = 1935
End
Begin VB.TextBox Text6
BackColor = &H00C0FFFF&
DataField = "完成日期"
DataSource = "Data1"
Height = 270
Left = 5160
TabIndex = 15
Top = 1640
Width = 1935
End
Begin VB.TextBox Text5
BackColor = &H00C0FFFF&
DataField = "維修人員"
DataSource = "Data1"
Height = 270
Left = 1440
TabIndex = 14
Top = 1640
Width = 1935
End
Begin VB.TextBox Text4
BackColor = &H00C0FFFF&
DataField = "報(bào)修日期"
DataSource = "Data1"
Height = 270
Left = 5160
TabIndex = 13
Top = 1040
Width = 1935
End
Begin VB.TextBox Text3
BackColor = &H00C0FFFF&
DataField = "住戶地址"
DataSource = "Data1"
Height = 270
Left = 1440
TabIndex = 12
Top = 1040
Width = 1935
End
Begin VB.TextBox Text2
BackColor = &H00C0FFFF&
DataField = "住戶名稱"
DataSource = "Data1"
Height = 270
Left = 5160
TabIndex = 11
Top = 440
Width = 1935
End
Begin VB.TextBox Text1
BackColor = &H00C0FFFF&
DataField = "單據(jù)編號"
DataSource = "Data1"
Height = 270
Left = 1440
TabIndex = 10
Top = 440
Width = 1935
End
Begin VB.Label Label9
Caption = "報(bào)修內(nèi)容:"
Height = 255
Left = 480
TabIndex = 9
Top = 2880
Width = 975
End
Begin VB.Label Label8
Caption = "物料費(fèi)用:"
Height = 255
Left = 4080
TabIndex = 8
Top = 2280
Width = 975
End
Begin VB.Label Label7
Caption = "維修費(fèi)用:"
Height = 255
Left = 480
TabIndex = 7
Top = 2280
Width = 975
End
Begin VB.Label Label6
Caption = "完成日期:"
Height = 255
Left = 4080
TabIndex = 6
Top = 1680
Width = 975
End
Begin VB.Label Label5
Caption = "維修人員:"
Height = 255
Left = 480
TabIndex = 5
Top = 1680
Width = 975
End
Begin VB.Label Label4
Caption = "報(bào)修日期:"
Height = 255
Left = 4080
TabIndex = 4
Top = 1080
Width = 975
End
Begin VB.Label Label3
Caption = "住戶地址:"
Height = 255
Left = 480
TabIndex = 3
Top = 1080
Width = 975
End
Begin VB.Label Label2
Caption = "住戶名稱:"
Height = 255
Left = 4080
TabIndex = 2
Top = 480
Width = 975
End
Begin VB.Label Label1
Caption = "單據(jù)編號:"
Height = 255
Left = 480
TabIndex = 1
Top = 480
Width = 975
End
End
End
Attribute VB_Name = "Form5"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Command1.Caption = "添 加" Then
Command1.Caption = "保 存"
Data1.Recordset.AddNew
Text1.Locked = False
Text2.Locked = False
Text3.Locked = False
Text4.Locked = False
Text5.Locked = False
Text6.Locked = False
Text7.Locked = False
Text8.Locked = False
Text9.Locked = False
Text1.SetFocus
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Exit Sub
Else
Text1.Locked = True
Text2.Locked = True
Text3.Locked = True
Text4.Locked = True
Text5.Locked = True
Text6.Locked = True
Text7.Locked = True
Text8.Locked = True
Text9.Locked = True
Data1.Recordset.Update
Data1.Recordset.MoveLast
Command1.Caption = "添 加"
Data1.Refresh
Command2.Enabled = True
Command3.Enabled = True
Command4.Enabled = True
End If
End Sub
Private Sub Command2_Click()
Dim d
d = MsgBox("是否真的刪除嗎?", vbYesNo + vbQuestion, "刪除")
If d = vbYes Then
Data1.Recordset.Delete
Data1.Recordset.MoveNext
If Data1.Recordset.EOF = True Then
Command4.Enabled = False
Data1.Recordset.MovePrevious
If Data1.Recordset.BOF = True Then
Command3.Enabled = False
Command2.Enabled = False
End If
End If
End If
Data1.Refresh
End Sub
Private Sub Command3_Click()
Data1.Recordset.MovePrevious
If Data1.Recordset.BOF Then
Command3.Enabled = False
Data1.Recordset.MoveNext
Else
Command3.Enabled = True
End If
Command4.Enabled = True
End Sub
Private Sub Command4_Click()
Data1.Recordset.MoveNext
If Data1.Recordset.EOF Then
Command4.Enabled = False
Data1.Recordset.MovePrevious
Else
Command4.Enabled = True
End If
Command3.Enabled = True
End Sub
Private Sub Command5_Click()
If Text1.Locked = True Or Text2.Locked = True Or Text3.Locked = True Or Text4.Locked = True Or Text5.Locked = True Then
Text1.Locked = False
Text2.Locked = False
Text3.Locked = False
Text4.Locked = False
Text5.Locked = False
MsgBox "請輸入查找編號"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text1.SetFocus
Else
Dim a
a = "單據(jù)編號=" & "'" & Text1.Text & "'"
Data1.Recordset.FindFirst a
If Data1.Recordset.NoMatch Then
MsgBox "沒有此記錄"
Else
Text1.Locked = True
Text2.Locked = True
Text3.Locked = True
Text4.Locked = True
Text5.Locked = True
End If
End If
End Sub
Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\db.mdb"
Data1.Refresh
Me.Width = 10560
Me.Height = 7650
If Data1.Recordset.EOF Then
Command2.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
End If
Text1.Locked = True
Text2.Locked = True
Text3.Locked = True
Text4.Locked = True
Text5.Locked = True
Text6.Locked = True
Text7.Locked = True
Text8.Locked = True
Text9.Locked = True
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -