frm_project.frm
资源名称:jtlc.rar [点击查看]
上传用户:xxdyjx888
上传日期:2022-06-01
资源大小:55k
文件大小:7k
源码类别:
家庭/个人应用
开发平台:
Visual Basic
- 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 'CenterOwner
- 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 = 3120
- TabIndex = 9
- Top = 840
- Width = 735
- End
- Begin VB.CommandButton cmd_save
- Caption = "保存"
- Height = 375
- Left = 2280
- 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 = 600
- TabIndex = 4
- Top = 840
- Width = 735
- End
- Begin VB.TextBox Text1
- Height = 300
- Left = 1200
- 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
- Tab = 1
- TabHeight = 520
- TabCaption(0) = "收入项目"
- TabPicture(0) = "frm_project.frx":030A
- Tab(0).ControlEnabled= 0 'False
- 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= -1 'True
- Tab(1).Control(0)= "MSHFlexGrid2"
- Tab(1).Control(0).Enabled= 0 'False
- Tab(1).ControlCount= 1
- Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid2
- Height = 3015
- Left = 0
- 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 = -75000
- 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