?? frm_zzrk_czfwgl.frm
字號:
Caption = "退出(&E)"
End
End
Attribute VB_Name = "frm_ZZRK_CZFWGL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFlie As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub ABOUT_Click()
frmAbout.Show
End Sub
Private Sub ADD_Click() '增加
If SSTab1.Tab = 0 Then
Adodc1.RecordSource = "select * from Table_ZZRK_CZFW order by 編號"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveLast
frm_ZZRK_CZFWXXXX.Text1.Text = Adodc1.Recordset.Fields("編號")
frm_ZZRK_CZFWXXXX.Text1.Text = Val(frm_ZZRK_CZFWXXXX.Text1.Text) + 1
Else
frm_ZZRK_CZFWXXXX.Text1.Text = 1000001
End If
frm_ZZRK_CZFWXXXX.Show
ElseIf SSTab1.Tab = 2 Then
DataGrid2.AllowAddNew = True
Adodc2.Recordset.AddNew
Adodc2.Refresh
End If
End Sub
Private Sub ALL_Click()
DataEnvironment1.rsczfw.Open "select * from Table_ZZRK_CZRXX "
If DataEnvironment1.rsczfw.RecordCount > 0 Then
DataRep_czfw.Show
Else
MsgBox "沒有出租房信息", 32, "人口信息管理系統"
DataEnvironment1.rsczfw.Close
End If
End Sub
Private Sub CZYSZ_Click()
frm_XTWH_CZYSZ.Show
End Sub
Private Sub DataGrid1_DblClick()
frm_ZZRK_CZFWXXXX.Show
End Sub
Private Sub DataGrid2_Error(ByVal DataError As Integer, Response As Integer)
Response = 0
MsgBox "輸入數據非法"
End Sub
Private Sub DataGrid3_Click()
Text4.Visible = False
Text5.Visible = True
DTPicker1.Visible = False
Text6.Visible = True
Text1.Text = Text7.Text
Text2.Text = Text8.Text
Text3.Text = Text9.Text
End Sub
Private Sub DEL_Click() '刪除
If SSTab1.Tab = 0 Then
If Adodc1.Recordset.EOF = False Then
c = MsgBox("您確認要刪除該記錄嗎?", 17, "人口信息管理系統")
If c = vbOK Then
Adodc1.Recordset.Delete
Adodc1.Refresh
Else
End If
Else
MsgBox "當前數據庫中已經沒有可刪除的記錄", 32, "人口信息管理系統"
End If
ElseIf SSTab1.Tab = 1 Then
If Adodc3.Recordset.EOF = False Then
c = MsgBox("您確認要刪除該記錄嗎?", 17, "人口信息管理系統")
If c = vbOK Then
Adodc3.Recordset.Delete
Adodc3.Refresh
Else
End If
Else
MsgBox "當前數據庫中已經沒有可刪除的記錄", 32, "人口信息管理系統"
End If
ElseIf SSTab1.Tab = 2 Then
If Adodc2.Recordset.EOF = False Then
c = MsgBox("您確認要刪除該記錄嗎?", 17, "人口信息管理系統")
If c = vbOK Then
Adodc2.Recordset.Delete
Adodc2.Refresh
Else
End If
Else
MsgBox "當前數據庫中已經沒有可刪除的記錄", 32, "人口信息管理系統"
End If
Else
End If
End Sub
Private Sub DYJSZ_Click()
CommonDialog1.ShowPrinter
End Sub
Private Sub EDIT1_Click()
If SSTab1.Tab = 0 Then
DataGrid1.AllowUpdate = True
DataGrid1.AllowUpdate = True
MsgBox "請直接修改數據表格中需要修改的記錄信息"
Else
End If
End Sub
Private Sub EXIT_Click()
Unload Me
End Sub
Private Sub Form_Load()
SSTab1.Tab = 0
End Sub
Private Sub FWWMDWZ_Click()
Dim HyperJump
Dim w
w = "www.mrsoft.com"
HyperJump = ShellExecute(0&, vbNullString, w, vbNullString, vbNullString, vbNormalFocus)
End Sub
Private Sub GHCZY_Click()
frm_XTDL.Show
End Sub
Private Sub GWMXX_Click()
Dim HyperJump
Dim w
w = "mailto:" + "mrsoft@163.com"
HyperJump = ShellExecute(0&, vbNullString, w, vbNullString, vbNullString, vbNormalFocus)
End Sub
Private Sub MAXG_Click()
frm_xgmm.Show
End Sub
Private Sub SAVE_Click() '保存
If SSTab1.Tab = 1 Then
Call main
If Text4.Text = "" Then
MsgBox "當前數據庫中沒有出租房屋的信息"
Else
Adodc3.RecordSource = "select * from Table_ZZRK_SHCZFW where 編號='" + Text4.Text + "'"
Adodc3.Refresh
If Adodc3.Recordset.RecordCount > 0 Then
MsgBox "此信息已經存在,不能夠保存信息"
Else
Set adoRs = adoCon.Execute("insert into Table_ZZRK_SHCZFW values(" & Text4 & ",'" & DTPicker1 & "','" & Text1 & "','" & Text2 & "','" & Text3 & "')")
MsgBox "數據保存成功!", 32, "人口信息管理系統"
Adodc3.RecordSource = "select * from Table_ZZRK_SHCZFW order by 編號"
Adodc3.Refresh
End If
End If
ElseIf SSTab1.Tab = 2 Then
If Adodc2.Recordset.RecordCount = 0 Then
MsgBox "沒有可保存的記錄", 32, "人口信息管理系統"
Else
Adodc2.Recordset.Update
MsgBox "數據保存成功", 32, "人口信息管理系統"
End If
End If
End Sub
Private Sub SJBF_Click()
frm_sjbfyhf.Show
frm_sjbfyhf.Caption = "數據備份"
frm_sjbfyhf.Command1.Visible = True
frm_sjbfyhf.Command4.Visible = False
frm_sjbfyhf.Frame1.Visible = True
frm_sjbfyhf.Frame2.Visible = False
frm_sjbfyhf.Picture1.Visible = True
frm_sjbfyhf.Picture2.Visible = False
End Sub
Private Sub SJHF_Click()
frm_sjbfyhf.Show
frm_sjbfyhf.Caption = "數據恢復"
frm_sjbfyhf.Command1.Visible = False
frm_sjbfyhf.Command4.Visible = True
frm_sjbfyhf.Frame1.Visible = False
frm_sjbfyhf.Frame2.Visible = True
frm_sjbfyhf.Picture1.Visible = False
frm_sjbfyhf.Picture2.Visible = True
End Sub
Private Sub SSTab1_Click(PreviousTab As Integer)
If SSTab1.Tab = 1 Then
Text4.Visible = True
Text5.Visible = False
DTPicker1.Visible = True
Text6.Visible = False
Toolbar1.Buttons(3).Enabled = False
Toolbar1.Buttons(6).Enabled = False
Toolbar1.Buttons(4).Enabled = True
ElseIf SSTab1.Tab = 2 Then
Toolbar1.Buttons(3).Enabled = False
Toolbar1.Buttons(6).Enabled = False
Toolbar1.Buttons(4).Enabled = True
ElseIf SSTab1.Tab = 0 Then
Toolbar1.Buttons(3).Enabled = True
Toolbar1.Buttons(6).Enabled = True
Toolbar1.Buttons(4).Enabled = False
Else
End If
End Sub
Private Sub Text10_Change()
End Sub
Private Sub Text5_Change()
'Text4.Text = Text5.Text
End Sub
Private Sub Text6_Change()
'DTPicker1.Value = Text6.Text
End Sub
Private Sub Text7_Change()
Text1.Text = Text7.Text
End Sub
Private Sub Text8_Change()
Text2.Text = Text8.Text
End Sub
Private Sub Text9_Change()
Text3.Text = Text9.Text
End Sub
Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) 'Toolbar控件代碼
Select Case Button.Index
Case 1
If SSTab1.Tab = 0 Then
Adodc1.RecordSource = "select * from Table_ZZRK_CZFW order by 編號"
Adodc1.Refresh
Text1.Text = ""
Text1.SetFocus
Text2.Text = ""
Text3.Text = ""
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveLast
frm_ZZRK_CZFWXXXX.Text1.Text = Adodc1.Recordset.Fields("編號")
frm_ZZRK_CZFWXXXX.Text1.Text = Val(frm_ZZRK_CZFWXXXX.Text1.Text) + 1
Else
frm_ZZRK_CZFWXXXX.Text1.Text = 1000001
End If
frm_ZZRK_CZFWXXXX.Show
ElseIf SSTab1.Tab = 1 Then
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text1.SetFocus
End If
Case 2
If SSTab1.Tab = 0 Then
If Adodc1.Recordset.EOF = False Then
c = MsgBox("您確認要刪除該記錄嗎?", 17, "人口信息管理系統")
If c = vbOK Then
Adodc1.Recordset.Delete
Adodc1.Refresh
Else
End If
Else
MsgBox "當前數據庫中已經沒有可刪除的記錄", 32, "人口信息管理系統"
End If
ElseIf SSTab1.Tab = 1 Then
If Adodc3.Recordset.EOF = False Then
c = MsgBox("您確認要刪除該記錄嗎?", 17, "人口信息管理系統")
If c = vbOK Then
Adodc3.Recordset.Delete
Adodc3.Refresh
Else
End If
Else
MsgBox "當前數據庫中已經沒有可刪除的記錄", 32, "人口信息管理系統"
End If
ElseIf SSTab1.Tab = 2 Then
If Adodc2.Recordset.EOF = False Then
c = MsgBox("您確認要刪除該記錄嗎?", 17, "人口信息管理系統")
If c = vbOK Then
Adodc2.Recordset.Delete
Adodc2.Refresh
Else
End If
Else
MsgBox "當前數據庫中已經沒有可刪除的記錄", 32, "人口信息管理系統"
End If
Else
End If
Case 3
If SSTab1.Tab = 0 Then
DataGrid1.AllowUpdate = True
DataGrid1.AllowUpdate = True
MsgBox "請直接修改數據表格中需要修改的記錄信息"
Else
End If
Case 4 '保存
Call main
If SSTab1.Tab = 1 Then
If Text4.Text = "" Then
MsgBox "當前數據庫中沒有出租房屋的信息"
Else
' Adodc3.RecordSource = "select * from Table_ZZRK_SHCZFW where 編號='" + Text4.Text + "'"
'' Adodc3.Refresh
' If Adodc3.Recordset.RecordCount > 0 Then
' MsgBox "此信息已經存在,不能夠保存信息"
' Else
Set adoRs = adoCon.Execute("insert into Table_ZZRK_SHCZFW values(" & Text4 & ",'" & DTPicker1 & "','" & Text1 & "','" & Text2 & "','" & Text3 & "')")
MsgBox "數據保存成功!", 32, "人口信息管理系統"
Adodc3.RecordSource = "select * from Table_ZZRK_SHCZFW order by 編號"
Adodc3.Refresh
' End If
End If
ElseIf SSTab1.Tab = 2 Then
If Adodc2.Recordset.RecordCount = 0 Then
MsgBox "沒有可保存的記錄", 32, "人口信息管理系統"
Else
Adodc2.Recordset.Update
MsgBox "數據保存成功", 32, "人口信息管理系統"
End If
End If
adoCon.Close
Case 5
Adodc1.RecordSource = "select * from Table_ZZRK_CZFW order by 編號"
Adodc1.Refresh
Adodc2.RecordSource = "select * from Table_ZZRK_CZRXX order by 編號"
Adodc2.Refresh
Adodc3.RecordSource = "select * from Table_ZZRK_SHCZFW order by 編號"
Adodc3.Refresh
'Case 6
'DataEnvironment1.rsczfw.Open "select * from Table_ZZRK_CZRXX "
' If DataEnvironment1.rsczfw.RecordCount > 0 Then
'DataRep_czfw.Show
' Else
' MsgBox "沒有出租房信息", 32, "人口信息管理系統"
' DataEnvironment1.rsczfw.Close
' End If
Case 6
Unload Me
End Select
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -