?? frm_czrk_lxfs.frm
字號:
Width = 975
End
Begin VB.CommandButton Cmd_cx
Caption = "查詢"
Height = 375
Left = 5640
TabIndex = 4
Top = 240
Width = 975
End
Begin VB.CommandButton Cmd_edit
Caption = "修改"
Height = 375
Left = 2400
TabIndex = 3
Top = 240
Width = 975
End
Begin VB.CommandButton Cmd_del
Caption = "刪除"
Height = 375
Left = 1320
TabIndex = 2
Top = 240
Width = 975
End
Begin VB.CommandButton Cmd_add
Caption = "增加"
Height = 375
Left = 240
TabIndex = 1
Top = 240
Width = 975
End
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 120
Top = 5640
Width = 7815
_ExtentX = 13785
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=RKGL"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=RKGL"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from Table_HKB_TXFS"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.TextBox Text10
DataField = "人口編號"
DataSource = "Adodc1"
Height = 375
Left = 600
TabIndex = 29
Text = "Text10"
Top = 4080
Width = 1575
End
Begin MSAdodcLib.Adodc Adodc2
Height = 375
Left = 1200
Top = 3720
Width = 2175
_ExtentX = 3836
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=RKGL"
OLEDBString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Data Source=RKGL"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from Table_HKB"
Caption = "Adodc2"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Attribute VB_Name = "frm_CZRK_LXFS"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Cmd_add_Click() '信息增加
Frame2.Caption = "居民聯(lián)系信息增加"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text7.Locked = False
Text8.Locked = False
Text9.Locked = False
Text1.SetFocus
Cmd_del.Enabled = False
Cmd_edit.Enabled = False
Cmd_save.Enabled = True
End Sub
Private Sub Cmd_cx_Click() '信息查詢
If Text1.Text = "" Then
MsgBox "請您輸入人口編號進行查詢社區(qū)人口的通訊信息", 32, "人口信息管理系統(tǒng)"
Text1.SetFocus
Else
Adodc1.RecordSource = "select * from Table_HKB_TXFS where 人口編號='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Text1.Text = Adodc1.Recordset.Fields("人口編號")
Text2.Text = Adodc1.Recordset.Fields("姓名")
Text3.Text = Adodc1.Recordset.Fields("樓號")
Text4.Text = Adodc1.Recordset.Fields("戶號")
Text5.Text = Adodc1.Recordset.Fields("住址")
Text6.Text = Adodc1.Recordset.Fields("電話")
Text7.Text = Adodc1.Recordset.Fields("傳真")
Text8.Text = Adodc1.Recordset.Fields("呼機")
Text9.Text = Adodc1.Recordset.Fields("E_mail")
Else
MsgBox "沒有此人的通訊信息", 32, "社區(qū)人口信息管理系統(tǒng)"
Text1.Text = ""
Text1.SetFocus
End If
End If
End Sub
Private Sub Cmd_del_Click() '信息刪除
Frame2.Caption = "居民聯(lián)系信息刪除"
Dim i
Adodc1.RecordSource = "select * from Table_HKB_TXFS"
If Adodc1.Recordset.RecordCount > 0 Then
i = MsgBox("您確認要刪除該信息么?", 17, "人口信息管理系統(tǒng)")
If i = vbOK Then
Adodc1.Recordset.Delete
Else
End If
Else
MsgBox "數(shù)據(jù)庫中已經(jīng)沒有可以刪除的記錄", 48, "人口信息管理系統(tǒng)"
End If
End Sub
Private Sub Cmd_edit_Click() '信息修改
Frame2.Caption = "居民聯(lián)系信息修改"
If Text1.Text = "" Then
MsgBox "輸入數(shù)據(jù)不能為空", 32, "提示'"
Text1.SetFocus
Else
Adodc1.RecordSource = "select * from Table_HKB_TXFS where 人口編號='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Text1.Text = Adodc1.Recordset.Fields("人口編號")
Text2.Text = Adodc1.Recordset.Fields("姓名")
Text3.Text = Adodc1.Recordset.Fields("樓號")
Text4.Text = Adodc1.Recordset.Fields("戶號")
Text5.Text = Adodc1.Recordset.Fields("住址")
Text6.Text = Adodc1.Recordset.Fields("電話")
Text7.Text = Adodc1.Recordset.Fields("傳真")
Text8.Text = Adodc1.Recordset.Fields("呼機")
Text9.Text = Adodc1.Recordset.Fields("E_mail")
Text7.Locked = False
Text8.Locked = False
Text9.Locked = False
Text7.SetFocus
Else
End If
End If
Cmd_save.Enabled = True
Cmd_add.Enabled = False
Cmd_del.Enabled = False
End Sub
Private Sub Cmd_exit_Click() '關(guān)閉窗體
Unload Me
End Sub
Private Sub Cmd_print_Click() '信息打印
DataEnvironment1.rsCommand1.Open "select * from Table_HKB_TXFS"
If DataEnvironment1.rsCommand1.RecordCount > 0 Then
Data_CZRK_TXFS.Show
Else
MsgBox "沒有可以打印的信息!"
DataEnvironment1.rsCommand1.Close
End If
End Sub
Private Sub Cmd_save_Click() '信息保存
Call main
If Frame2.Caption = "居民聯(lián)系信息增加" Then
If Text1.Text = "" Then
MsgBox "輸入數(shù)據(jù)不能為空", 32, "提示"
Text1.SetFocus
Else
Adodc1.RecordSource = "select * from Table_HKB_TXFS where 人口編號='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
MsgBox "此人的通訊方式已經(jīng)存在!", 48, "提示"
Else
Set adoRs = adoCon.Execute("insert into Table_HKB_TXFS values(" & Text1 & ",'" & Text2 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "')")
MsgBox "數(shù)據(jù)保存成功", 32, "提示"
Adodc1.RecordSource = "select * from Table_HKB_TXFS order by 人口編號"
Adodc1.Refresh
End If
Cmd_save.Enabled = False
Cmd_add.Enabled = True
Cmd_del.Enabled = True
Cmd_edit.Enabled = True
End If
Adodc1.Refresh
ElseIf Frame2.Caption = "居民聯(lián)系信息修改" Then
Adodc1.RecordSource = "select * from Table_HKB_TXFS"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.Delete
Set adoRs = adoCon.Execute("insert into Table_HKB_TXFS values(" & Text1 & ",'" & Text2 & "','" & Text3 & "','" & Text4 & "','" & Text5 & "','" & Text6 & "','" & Text7 & "','" & Text8 & "','" & Text9 & "')")
MsgBox "數(shù)據(jù)修改成功", 32, "提示"
Else
MsgBox "沒有可以修改的信息", 32, "提示"
End If
Adodc1.RecordSource = "select * from Table_HKB_TXFS order by 人口編號"
Adodc1.Refresh
End If
adoCon.Close
End Sub
Private Sub Cmd_sx_Click()
Cmd_add.Enabled = True
Cmd_del.Enabled = True
Cmd_edit.Enabled = True
Cmd_save.Enabled = False
Adodc1.RecordSource = "select * from Table_HKB_TXFS order by 人口編號"
Adodc1.Refresh
End Sub
Private Sub Form_Load()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
If Text1.Text = "" Then
frm_CZRK_TEMP1.Show
Else
Dim StrInput, Temp As String
Dim i, Length As Integer
i = 1
StrInput = Text1.Text
Length = Len(StrInput)
Do While (i <= Length)
Temp = Mid$(StrInput, i, 1)
If Asc(Temp) < 48 Or Asc(Temp) > 57 Then
If i = 1 Then
MsgBox "輸入數(shù)據(jù)非法!!", , "提示"
Else
End If
Text1.Text = ""
Text1.SetFocus
Else
End If
i = i + 1
Loop
If Text1.Text = "" Then
Text1.SetFocus
Else
Adodc2.RecordSource = "select * from Table_HKB where 人口編號='" + Text1.Text + "'"
Adodc2.Refresh
If Adodc2.Recordset.RecordCount > 0 Then
Adodc1.RecordSource = "select * from Table_HKB_TXFS where 人口編號='" + Text1.Text + "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
MsgBox "此人的通訊方式已經(jīng)存在!", 48, "提示"
Adodc1.RecordSource = "select * from Table_HKB_TXFS order by 人口編號"
Adodc1.Refresh
Text1.Text = ""
Text1.SetFocus
Else
Text7.SetFocus
Adodc1.RecordSource = "select * from Table_HKB_TXFS order by 人口編號"
Adodc1.Refresh
End If
Text2.Text = Adodc2.Recordset.Fields("姓名")
Text3.Text = Adodc2.Recordset.Fields("樓號")
Text4.Text = Adodc2.Recordset.Fields("戶號")
Text5.Text = Adodc2.Recordset.Fields("住址")
Text6.Text = Adodc2.Recordset.Fields("聯(lián)系電話2")
Else
MsgBox "沒有此人口編號!", 48, "提示"
End If
End If
End If
Else
End If
End Sub
Private Sub Text7_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Dim StrInput, Temp As String
Dim i, Length As Integer
i = 1
StrInput = Text1.Text
Length = Len(StrInput)
If Text1.Text = "" Then
MsgBox "輸入不能為空", , "提示"
Text1.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 "輸入數(shù)據(jù)非法!!", , "提示"
Else
End If
Text1.Text = ""
Text1.SetFocus
Else
End If
i = i + 1
Loop
If Text1.Text = "" Then
Text1.SetFocus
Else
Text8.SetFocus
End If
End If
Else
End If
End Sub
Private Sub Text8_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text9.SetFocus
Else
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -