frm_project.frm
上传用户:xxdyjx888
上传日期:2022-06-01
资源大小:55k
文件大小:7k
源码类别:

家庭/个人应用

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  3. Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
  4. Begin VB.Form frm_project 
  5.    Caption         =   "项目管理"
  6.    ClientHeight    =   4830
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   4470
  10.    Icon            =   "frm_project.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    ScaleHeight     =   4830
  14.    ScaleWidth      =   4470
  15.    StartUpPosition =   1  'CenterOwner
  16.    Begin VB.Frame Frame1 
  17.       BackColor       =   &H80000000&
  18.       Height          =   1335
  19.       Left            =   0
  20.       TabIndex        =   1
  21.       Top             =   3480
  22.       Width           =   4455
  23.       Begin VB.CommandButton cmd_cancel 
  24.          Caption         =   "取消"
  25.          Height          =   375
  26.          Left            =   3120
  27.          TabIndex        =   9
  28.          Top             =   840
  29.          Width           =   735
  30.       End
  31.       Begin VB.CommandButton cmd_save 
  32.          Caption         =   "保存"
  33.          Height          =   375
  34.          Left            =   2280
  35.          TabIndex        =   6
  36.          Top             =   840
  37.          Width           =   735
  38.       End
  39.       Begin VB.CommandButton cmd_del 
  40.          Caption         =   "删除"
  41.          Height          =   375
  42.          Left            =   1440
  43.          TabIndex        =   5
  44.          Top             =   840
  45.          Width           =   735
  46.       End
  47.       Begin VB.CommandButton cmd_add 
  48.          Caption         =   "添加"
  49.          Height          =   375
  50.          Left            =   600
  51.          TabIndex        =   4
  52.          Top             =   840
  53.          Width           =   735
  54.       End
  55.       Begin VB.TextBox Text1 
  56.          Height          =   300
  57.          Left            =   1200
  58.          TabIndex        =   3
  59.          Top             =   240
  60.          Width           =   1575
  61.       End
  62.       Begin VB.Label Label1 
  63.          BackStyle       =   0  'Transparent
  64.          Caption         =   "值:"
  65.          Height          =   255
  66.          Left            =   720
  67.          TabIndex        =   2
  68.          Top             =   360
  69.          Width           =   495
  70.       End
  71.    End
  72.    Begin TabDlg.SSTab SSTab1 
  73.       Height          =   3495
  74.       Left            =   0
  75.       TabIndex        =   0
  76.       Top             =   0
  77.       Width           =   4605
  78.       _ExtentX        =   8123
  79.       _ExtentY        =   6165
  80.       _Version        =   393216
  81.       Style           =   1
  82.       Tabs            =   2
  83.       Tab             =   1
  84.       TabHeight       =   520
  85.       TabCaption(0)   =   "收入项目"
  86.       TabPicture(0)   =   "frm_project.frx":030A
  87.       Tab(0).ControlEnabled=   0   'False
  88.       Tab(0).Control(0)=   "MSHFlexGrid1"
  89.       Tab(0).Control(0).Enabled=   0   'False
  90.       Tab(0).ControlCount=   1
  91.       TabCaption(1)   =   "支出项目"
  92.       TabPicture(1)   =   "frm_project.frx":0326
  93.       Tab(1).ControlEnabled=   -1  'True
  94.       Tab(1).Control(0)=   "MSHFlexGrid2"
  95.       Tab(1).Control(0).Enabled=   0   'False
  96.       Tab(1).ControlCount=   1
  97.       Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid2 
  98.          Height          =   3015
  99.          Left            =   0
  100.          TabIndex        =   8
  101.          Top             =   360
  102.          Width           =   4455
  103.          _ExtentX        =   7858
  104.          _ExtentY        =   5318
  105.          _Version        =   393216
  106.          AllowUserResizing=   1
  107.          _NumberOfBands  =   1
  108.          _Band(0).Cols   =   2
  109.       End
  110.       Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid1 
  111.          Height          =   3015
  112.          Left            =   -75000
  113.          TabIndex        =   7
  114.          Top             =   360
  115.          Width           =   4455
  116.          _ExtentX        =   7858
  117.          _ExtentY        =   5318
  118.          _Version        =   393216
  119.          AllowUserResizing=   1
  120.          _NumberOfBands  =   1
  121.          _Band(0).Cols   =   2
  122.       End
  123.    End
  124. End
  125. Attribute VB_Name = "frm_project"
  126. Attribute VB_GlobalNameSpace = False
  127. Attribute VB_Creatable = False
  128. Attribute VB_PredeclaredId = True
  129. Attribute VB_Exposed = False
  130. Dim Mydb1 As ADODB.Recordset
  131. Dim Mydb2 As ADODB.Recordset
  132. Dim Mydb3 As ADODB.Recordset
  133. Dim Mydb4 As ADODB.Recordset
  134. Dim Str_text As String
  135. '
  136. Private Function Db1()
  137.         Set Mydb1 = ExeCutesql("select * from 收入项目", Str_text)
  138.         Set MSHFlexGrid1.DataSource = Mydb1
  139. End Function
  140. Private Function Db2()
  141.         Set Mydb2 = ExeCutesql("select * from 支出项目", Str_text)
  142.         Set MSHFlexGrid2.DataSource = Mydb2
  143. End Function
  144. Private Sub cmd_add_Click()
  145.             Text1.Locked = False
  146. End Sub
  147. Private Sub cmd_cancel_Click()
  148.             Unload Me
  149. End Sub
  150. Private Sub cmd_del_Click()
  151.             On Error Resume Next
  152.             Dim A As Boolean
  153.             
  154.             Set Mydb3 = ExeCutesql("select * from 收入项目 where value='" & Text1.Text & "' ", Str_text)
  155.             If SSTab1.Tab = 0 Then
  156.                A = MsgBox("是否删除当前记录", vbYesNo + 32 + 256, "删除记录")
  157.                If A = True Then
  158.                   Mydb3.Delete
  159.                   Mydb3.MoveNext
  160.                If Mydb3.EOF Then Mydb.MoveLast
  161.                   Mydb3.Requery
  162.                   Call Db1
  163.                End If
  164.             Else
  165.                Set Mydb4 = ExeCutesql("select * from 支出项目 where value='" & Text1.Text & "' ", Str_text)
  166.                A = MsgBox("是否删除当前记录", vbYesNo + 32 + 256, "删除记录")
  167.                If A = True Then
  168.                   Mydb4.Delete
  169.                   Mydb4.MoveNext
  170.                If Mydb4.EOF Then Mydb2.MoveLast
  171.                   Mydb4.Requery
  172.                   Call Db2
  173.                End If
  174.             End If
  175. End Sub
  176. Private Sub cmd_save_Click()
  177.             On Error Resume Next
  178.             Dim A As Boolean
  179.                         
  180.                If SSTab1.Tab = 0 Then
  181.                   A = MsgBox("是否添加前记录?", vbYesNo + 32, "添加记录")
  182.                   If A = True Then
  183.                      ExeCutesql "insert into 收入项目 values('" & Text1.Text & "')", Str_text
  184.                      Mydb1.MoveLast
  185.                      Call Db1
  186.                      MsgBox "收入项目添加成功!", vbOKOnly + 64, ""
  187.                      Text1.Text = ""
  188.                   End If
  189.                Else
  190.                   A = MsgBox("是否添加前记录?", vbYesNo + 32, "添加记录")
  191.                      If A = True Then
  192.                         ExeCutesql "insert into 支出项目 values('" & Text1.Text & "')", Str_text
  193.                         Mydb2.MoveLast
  194.                         Call Db2
  195.                         MsgBox "支出项目添加成功!", vbOKOnly + 64, ""
  196.                         Text1.Text = ""
  197.                      End If
  198.                End If
  199. End Sub
  200. Private Sub Form_Load()
  201.         Text1.Locked = True
  202.         Call Db1
  203.         Call Db2
  204. End Sub
  205. Private Sub MSHFlexGrid1_Click()
  206.             Text1.Text = MSHFlexGrid1.TextMatrix(MSHFlexGrid1.Row, 1)
  207. End Sub
  208. Private Sub MSHFlexGrid2_Click()
  209.             Text1.Text = MSHFlexGrid2.TextMatrix(MSHFlexGrid2.Row, 1)
  210. End Sub