?? frm_project.frm
字號:
VERSION 5.00
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form frm_project
Caption = "項目管理"
ClientHeight = 4830
ClientLeft = 60
ClientTop = 345
ClientWidth = 4470
Icon = "frm_project.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4830
ScaleWidth = 4470
StartUpPosition = 1 '所有者中心
Begin VB.Frame Frame1
BackColor = &H80000000&
Height = 1335
Left = 0
TabIndex = 1
Top = 3480
Width = 4455
Begin VB.CommandButton cmd_cancel
Caption = "取消"
Height = 375
Left = 2880
TabIndex = 9
Top = 840
Width = 735
End
Begin VB.CommandButton cmd_save
Caption = "保存"
Height = 375
Left = 2160
TabIndex = 6
Top = 840
Width = 735
End
Begin VB.CommandButton cmd_del
Caption = "刪除"
Height = 375
Left = 1440
TabIndex = 5
Top = 840
Width = 735
End
Begin VB.CommandButton cmd_add
Caption = "添加"
Height = 375
Left = 720
TabIndex = 4
Top = 840
Width = 735
End
Begin VB.TextBox Text1
Height = 300
Left = 1080
TabIndex = 3
Top = 240
Width = 1575
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "值:"
Height = 255
Left = 720
TabIndex = 2
Top = 360
Width = 495
End
End
Begin TabDlg.SSTab SSTab1
Height = 3495
Left = 0
TabIndex = 0
Top = 0
Width = 4605
_ExtentX = 8123
_ExtentY = 6165
_Version = 393216
Style = 1
Tabs = 2
TabHeight = 520
TabCaption(0) = "收入項目"
TabPicture(0) = "frm_project.frx":030A
Tab(0).ControlEnabled= -1 'True
Tab(0).Control(0)= "MSHFlexGrid1"
Tab(0).Control(0).Enabled= 0 'False
Tab(0).ControlCount= 1
TabCaption(1) = "支出項目"
TabPicture(1) = "frm_project.frx":0326
Tab(1).ControlEnabled= 0 'False
Tab(1).Control(0)= "MSHFlexGrid2"
Tab(1).Control(0).Enabled= 0 'False
Tab(1).ControlCount= 1
Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid2
Height = 3015
Left = -75000
TabIndex = 8
Top = 360
Width = 4455
_ExtentX = 7858
_ExtentY = 5318
_Version = 393216
AllowUserResizing= 1
_NumberOfBands = 1
_Band(0).Cols = 2
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid1
Height = 3015
Left = 0
TabIndex = 7
Top = 360
Width = 4455
_ExtentX = 7858
_ExtentY = 5318
_Version = 393216
AllowUserResizing= 1
_NumberOfBands = 1
_Band(0).Cols = 2
End
End
End
Attribute VB_Name = "frm_project"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Mydb1 As ADODB.Recordset
Dim Mydb2 As ADODB.Recordset
Dim Mydb3 As ADODB.Recordset
Dim Mydb4 As ADODB.Recordset
Dim Str_text As String
'
Private Function Db1()
Set Mydb1 = ExeCutesql("select * from 收入項目", Str_text)
Set MSHFlexGrid1.DataSource = Mydb1
End Function
Private Function Db2()
Set Mydb2 = ExeCutesql("select * from 支出項目", Str_text)
Set MSHFlexGrid2.DataSource = Mydb2
End Function
Private Sub cmd_add_Click()
Text1.Locked = False
End Sub
Private Sub cmd_cancel_Click()
Unload Me
End Sub
Private Sub cmd_del_Click()
On Error Resume Next
Dim A As Boolean
Set Mydb3 = ExeCutesql("select * from 收入項目 where value='" & Text1.Text & "' ", Str_text)
If SSTab1.Tab = 0 Then
A = MsgBox("是否刪除當前記錄", vbYesNo + 32 + 256, "刪除記錄")
If A = True Then
Mydb3.Delete
Mydb3.MoveNext
If Mydb3.EOF Then Mydb.MoveLast
Mydb3.Requery
Call Db1
End If
Else
Set Mydb4 = ExeCutesql("select * from 支出項目 where value='" & Text1.Text & "' ", Str_text)
A = MsgBox("是否刪除當前記錄", vbYesNo + 32 + 256, "刪除記錄")
If A = True Then
Mydb4.Delete
Mydb4.MoveNext
If Mydb4.EOF Then Mydb2.MoveLast
Mydb4.Requery
Call Db2
End If
End If
End Sub
Private Sub cmd_save_Click()
On Error Resume Next
Dim A As Boolean
If SSTab1.Tab = 0 Then
A = MsgBox("是否添加前記錄?", vbYesNo + 32, "添加記錄")
If A = True Then
ExeCutesql "insert into 收入項目 values('" & Text1.Text & "')", Str_text
Mydb1.MoveLast
Call Db1
MsgBox "收入項目添加成功!", vbOKOnly + 64, ""
Text1.Text = ""
End If
Else
A = MsgBox("是否添加前記錄?", vbYesNo + 32, "添加記錄")
If A = True Then
ExeCutesql "insert into 支出項目 values('" & Text1.Text & "')", Str_text
Mydb2.MoveLast
Call Db2
MsgBox "支出項目添加成功!", vbOKOnly + 64, ""
Text1.Text = ""
End If
End If
End Sub
Private Sub Form_Load()
Text1.Locked = True
Call Db1
Call Db2
End Sub
Private Sub MSHFlexGrid1_Click()
Text1.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 1)
End Sub
Private Sub MSHFlexGrid2_Click()
Text1.Text = MSHFlexGrid2.TextMatrix(MSHFlexGrid2.Row, 1)
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -