?? 房屋及住戶資料.frm
字號:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form form2
Caption = "房屋及住戶資料"
ClientHeight = 7425
ClientLeft = 2370
ClientTop = 3015
ClientWidth = 10815
Icon = "房屋及住戶資料.frx":0000
LinkTopic = "Form2"
MDIChild = -1 'True
ScaleHeight = 7425
ScaleWidth = 10815
Begin VB.Frame Frame2
Height = 2655
Left = 240
TabIndex = 21
Top = 4680
Width = 10335
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Bindings = "房屋及住戶資料.frx":08CA
Height = 2295
Left = 120
TabIndex = 22
Top = 240
Width = 10095
_ExtentX = 17806
_ExtentY = 4048
_Version = 393216
BackColor = 12648447
BackColorFixed = 16777215
BackColorBkg = 12640511
End
End
Begin VB.Frame Frame1
Height = 4455
Left = 240
TabIndex = 0
Top = 120
Width = 10335
Begin VB.CommandButton Command5
Caption = "查 找"
Height = 375
Left = 8400
TabIndex = 27
Top = 2760
Width = 1335
End
Begin VB.CommandButton Command4
Caption = "下一條"
Height = 375
Left = 8400
TabIndex = 26
Top = 2160
Width = 1335
End
Begin VB.CommandButton Command3
Caption = "上一條"
Height = 375
Left = 8400
TabIndex = 25
Top = 1560
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "刪 除"
Height = 375
Left = 8400
TabIndex = 24
Top = 960
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "添 加"
Height = 375
Left = 8400
TabIndex = 23
Top = 360
Width = 1335
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "D:\zj\db.mdb"
DefaultCursorType= 0 '缺省游標
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 6240
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "房屋及住戶資料"
Top = 2760
Visible = 0 'False
Width = 1500
End
Begin VB.TextBox Text1
BackColor = &H00C0FFFF&
DataField = "樓宇單元"
DataSource = "Data1"
Height = 270
Left = 1680
TabIndex = 10
Top = 360
Width = 1935
End
Begin VB.TextBox Text2
BackColor = &H00C0FFFF&
DataField = "住戶名稱"
DataSource = "Data1"
Height = 270
Left = 5880
TabIndex = 9
Top = 360
Width = 1935
End
Begin VB.TextBox Text3
BackColor = &H00C0FFFF&
DataField = "樓層"
DataSource = "Data1"
Height = 270
Left = 1680
TabIndex = 8
Top = 960
Width = 1935
End
Begin VB.TextBox Text4
BackColor = &H00C0FFFF&
DataField = "聯系電話"
DataSource = "Data1"
Height = 270
Left = 5880
TabIndex = 7
Top = 960
Width = 1935
End
Begin VB.TextBox Text5
BackColor = &H00C0FFFF&
DataField = "房號"
DataSource = "Data1"
Height = 270
Left = 1680
TabIndex = 6
Top = 1560
Width = 1935
End
Begin VB.TextBox Text6
BackColor = &H00C0FFFF&
DataField = "使用狀況"
DataSource = "Data1"
Height = 270
Left = 5880
TabIndex = 5
Top = 1560
Width = 1935
End
Begin VB.TextBox Text7
BackColor = &H00C0FFFF&
DataField = "房型"
DataSource = "Data1"
Height = 270
Left = 1680
TabIndex = 4
Top = 2160
Width = 1935
End
Begin VB.TextBox Text8
BackColor = &H00C0FFFF&
DataField = "遷入時間"
DataSource = "Data1"
Height = 270
Left = 5880
TabIndex = 3
Top = 2160
Width = 1935
End
Begin VB.TextBox Text9
BackColor = &H00C0FFFF&
DataField = "建筑面積"
DataSource = "Data1"
Height = 270
Left = 1680
TabIndex = 2
Top = 2760
Width = 1935
End
Begin VB.TextBox Text10
BackColor = &H00C0FFFF&
DataField = "住戶備注"
DataSource = "Data1"
Height = 855
Left = 1680
MultiLine = -1 'True
TabIndex = 1
Top = 3360
Width = 6495
End
Begin VB.Label Label1
Caption = "樓宇單元:"
Height = 255
Left = 600
TabIndex = 20
Top = 405
Width = 975
End
Begin VB.Label Label2
Caption = "樓層:"
Height = 255
Left = 600
TabIndex = 19
Top = 1005
Width = 615
End
Begin VB.Label Label3
Caption = "房號:"
Height = 255
Left = 600
TabIndex = 18
Top = 1605
Width = 615
End
Begin VB.Label Label4
Caption = "房型:"
Height = 255
Left = 600
TabIndex = 17
Top = 2205
Width = 615
End
Begin VB.Label Label5
Caption = "建筑面積:"
Height = 255
Left = 600
TabIndex = 16
Top = 2805
Width = 975
End
Begin VB.Label Label6
Caption = "使用狀況:"
Height = 255
Left = 4800
TabIndex = 15
Top = 1605
Width = 975
End
Begin VB.Label Label7
Caption = "遷入時間:"
Height = 255
Left = 4800
TabIndex = 14
Top = 2205
Width = 975
End
Begin VB.Label Label8
Caption = "住戶名稱:"
Height = 255
Left = 4800
TabIndex = 13
Top = 405
Width = 975
End
Begin VB.Label Label9
Caption = "聯系電話:"
Height = 255
Left = 4800
TabIndex = 12
Top = 1005
Width = 975
End
Begin VB.Label Label10
Caption = "住戶備注:"
Height = 255
Left = 600
TabIndex = 11
Top = 3405
Width = 975
End
End
End
Attribute VB_Name = "form2"
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
Text10.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
Text10.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()
'Download by http://www.codefans.net
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 = "樓宇單元=" & "'" & 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 = 10935
Me.Height = 7830
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
Text10.Locked = True
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -