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

家庭/个人应用

开发平台:

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_list 
  5.    Caption         =   "理财报告"
  6.    ClientHeight    =   6765
  7.    ClientLeft      =   60
  8.    ClientTop       =   345
  9.    ClientWidth     =   9375
  10.    Icon            =   "frm_list.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    ScaleHeight     =   6765
  14.    ScaleWidth      =   9375
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.CommandButton Command3 
  17.       Caption         =   "关闭"
  18.       Height          =   375
  19.       Left            =   8280
  20.       TabIndex        =   12
  21.       Top             =   6120
  22.       Width           =   975
  23.    End
  24.    Begin VB.CommandButton Command2 
  25.       Caption         =   "其他月份"
  26.       Height          =   375
  27.       Left            =   7320
  28.       TabIndex        =   11
  29.       Top             =   6120
  30.       Width           =   975
  31.    End
  32.    Begin VB.CommandButton Command1 
  33.       Caption         =   "饼图"
  34.       Height          =   375
  35.       Left            =   6360
  36.       TabIndex        =   10
  37.       Top             =   6120
  38.       Width           =   975
  39.    End
  40.    Begin TabDlg.SSTab SSTab1 
  41.       Height          =   5775
  42.       Left            =   0
  43.       TabIndex        =   0
  44.       Top             =   0
  45.       Width           =   9405
  46.       _ExtentX        =   16589
  47.       _ExtentY        =   10186
  48.       _Version        =   393216
  49.       Tabs            =   2
  50.       Tab             =   1
  51.       TabHeight       =   520
  52.       ForeColor       =   -2147483642
  53.       TabCaption(0)   =   "本月收入情况"
  54.       TabPicture(0)   =   "frm_list.frx":030A
  55.       Tab(0).ControlEnabled=   0   'False
  56.       Tab(0).Control(0)=   "MSHFlexGrid1"
  57.       Tab(0).Control(1)=   "Label7"
  58.       Tab(0).Control(2)=   "Label2"
  59.       Tab(0).Control(3)=   "Label1"
  60.       Tab(0).ControlCount=   4
  61.       TabCaption(1)   =   "本月支出情况"
  62.       TabPicture(1)   =   "frm_list.frx":0326
  63.       Tab(1).ControlEnabled=   -1  'True
  64.       Tab(1).Control(0)=   "Label6"
  65.       Tab(1).Control(0).Enabled=   0   'False
  66.       Tab(1).Control(1)=   "Label8"
  67.       Tab(1).Control(1).Enabled=   0   'False
  68.       Tab(1).Control(2)=   "Label9"
  69.       Tab(1).Control(2).Enabled=   0   'False
  70.       Tab(1).Control(3)=   "MSHFlexGrid2"
  71.       Tab(1).Control(3).Enabled=   0   'False
  72.       Tab(1).ControlCount=   4
  73.       Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid2 
  74.          Height          =   5055
  75.          Left            =   0
  76.          TabIndex        =   9
  77.          Top             =   720
  78.          Width           =   9375
  79.          _ExtentX        =   16536
  80.          _ExtentY        =   8916
  81.          _Version        =   393216
  82.          AllowUserResizing=   1
  83.          _NumberOfBands  =   1
  84.          _Band(0).Cols   =   2
  85.       End
  86.       Begin MSHierarchicalFlexGridLib.MSHFlexGrid MSHFlexGrid1 
  87.          Height          =   5055
  88.          Left            =   -75000
  89.          TabIndex        =   8
  90.          Top             =   720
  91.          Width           =   9375
  92.          _ExtentX        =   16536
  93.          _ExtentY        =   8916
  94.          _Version        =   393216
  95.          AllowUserResizing=   1
  96.          _NumberOfBands  =   1
  97.          _Band(0).Cols   =   2
  98.       End
  99.       Begin VB.Label Label9 
  100.          Caption         =   "元"
  101.          Height          =   255
  102.          Left            =   2880
  103.          TabIndex        =   6
  104.          Top             =   480
  105.          Width           =   495
  106.       End
  107.       Begin VB.Label Label8 
  108.          ForeColor       =   &H000000FF&
  109.          Height          =   255
  110.          Left            =   1800
  111.          TabIndex        =   5
  112.          Top             =   480
  113.          Width           =   1095
  114.       End
  115.       Begin VB.Label Label6 
  116.          Caption         =   "本月支出:"
  117.          Height          =   255
  118.          Left            =   840
  119.          TabIndex        =   4
  120.          Top             =   480
  121.          Width           =   975
  122.       End
  123.       Begin VB.Label Label7 
  124.          Caption         =   "元"
  125.          Height          =   255
  126.          Left            =   -72120
  127.          TabIndex        =   3
  128.          Top             =   480
  129.          Width           =   495
  130.       End
  131.       Begin VB.Label Label2 
  132.          ForeColor       =   &H00FF0000&
  133.          Height          =   255
  134.          Left            =   -73200
  135.          TabIndex        =   2
  136.          Top             =   480
  137.          Width           =   1095
  138.       End
  139.       Begin VB.Label Label1 
  140.          Caption         =   "本月收入:"
  141.          Height          =   255
  142.          Left            =   -74160
  143.          TabIndex        =   1
  144.          Top             =   480
  145.          Width           =   975
  146.       End
  147.    End
  148.    Begin VB.Label Label13 
  149.       AutoSize        =   -1  'True
  150.       BeginProperty Font 
  151.          Name            =   "宋体"
  152.          Size            =   21.75
  153.          Charset         =   134
  154.          Weight          =   400
  155.          Underline       =   0   'False
  156.          Italic          =   0   'False
  157.          Strikethrough   =   0   'False
  158.       EndProperty
  159.       ForeColor       =   &H000000FF&
  160.       Height          =   435
  161.       Left            =   120
  162.       TabIndex        =   7
  163.       Top             =   6000
  164.       Width           =   225
  165.    End
  166. End
  167. Attribute VB_Name = "frm_list"
  168. Attribute VB_GlobalNameSpace = False
  169. Attribute VB_Creatable = False
  170. Attribute VB_PredeclaredId = True
  171. Attribute VB_Exposed = False
  172. Dim Mydb As New ADODB.Recordset
  173. Dim Mydb1 As New ADODB.Recordset
  174. Dim Money As New ADODB.Recordset
  175. Dim Money1 As New ADODB.Recordset
  176. Dim Str_text As String
  177. Private Sub Command1_Click()
  178.             frm_rate.Show
  179. End Sub
  180. Private Sub Command2_Click()
  181.             frm_date.Show
  182. End Sub
  183. Private Sub Command3_Click()
  184.             Unload Me
  185. End Sub
  186. Private Sub Form_Activate()
  187.             On Error Resume Next
  188.             Dim A, B, C As Integer
  189.             Dim D As String
  190.             Dim Year1, Month1, Riqi, Riqi1, Riqi3, Riqi4
  191.             
  192.             If AA = True Then
  193.                Set Mydb = ExeCutesql("select * from 收入 where 日期 between '" & Cdate1 & "' and '" & Cdate2 & "' ", "")
  194.                Set MSHFlexGrid1.DataSource = Mydb
  195.                Set Mydb1 = ExeCutesql("select * from 支出 where 日期 between '" & Cdate1 & "' and '" & Cdate2 & "' ", "")
  196.                Set MSHFlexGrid2.DataSource = Mydb1
  197.                
  198.                Set Money = ExeCutesql("select sum(金额) from 收入 where 日期  between '" & Cdate1 & "'and '" & Cdate2 & "'", "")
  199.                    A = Money.Fields(0)
  200.                    If IsNull(A) Then
  201.                       A = 0
  202.                    End If
  203.                    Label2.Caption = A
  204.                Set Money1 = ExeCutesql("select sum(金额) from 支出 where 日期  between '" & Cdate1 & "'and '" & Cdate2 & "'", "")
  205.                    B = Money1.Fields(0)
  206.                    If IsNull(B) Then
  207.                       B = 0
  208.                    End If
  209.                    Label8.Caption = B
  210.                C = A - B
  211.                If C > 0 Then
  212.                   D = "富裕"
  213.                Else
  214.                   D = "超支"
  215.                End If
  216.                Label13.Caption = Format(Cdate1, "yyyy年mm月") & "," & "本月你" & D & C & "元!"
  217.             Else
  218.                 Year1 = Year(Now)
  219.                 Month1 = Month(Now)
  220.                 Riqi = Year1 & "-" & Month1
  221.                 Riqi1 = Year1 & "-" & Month1 + 1
  222.             
  223.                 Set Mydb = ExeCutesql("select * from 收入 where 日期  between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", Str_text)
  224.                 Set MSHFlexGrid1.DataSource = Mydb
  225.                 Set MSHFlexGrid2.DataSource = Mydb1
  226.             
  227.                 Set Money = ExeCutesql("select sum(金额) from 收入 where 日期  between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", "")
  228.                     A = Money.Fields(0)
  229.                     If IsNull(A) Then
  230.                        A = 0
  231.                     End If
  232.                     Label2.Caption = A
  233.                
  234.                 Set Money1 = ExeCutesql("select sum(金额) from 支出 where 日期  between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", "")
  235.                     B = Money1.Fields(0)
  236.                     If IsNull(B) Then
  237.                        B = 0
  238.                     End If
  239.                     Label8.Caption = B
  240.                     
  241.                C = A - B
  242.                If C > 0 Then
  243.                   D = "富裕"
  244.                Else
  245.                   D = "超支"
  246.                End If
  247.                Label13.Caption = Year(Now) & "年" & Month(Now) & "月" & "," & "本月你" & D & C & "元!"
  248.             End If
  249. End Sub
  250. Private Sub Form_Load()
  251.             On Error Resume Next
  252.             Dim A, B, C As Integer
  253.             Dim D As String
  254.             Dim Year1, Month1, Riqi, Riqi1, Riqi3, Riqi4
  255.             
  256.             Year1 = Year(Now)
  257.             Month1 = Month(Now)
  258.             Riqi = Year1 & "-" & Month1
  259.             Riqi1 = Year1 & "-" & Month1 + 1
  260.             
  261.             Set Mydb = ExeCutesql("select * from 收入 where 日期  between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", Str_text)
  262.             Set MSHFlexGrid1.DataSource = Mydb
  263.             Set Mydb1 = ExeCutesql("select * from 支出 where 日期  between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", Str_text)
  264.             Set MSHFlexGrid2.DataSource = Mydb1
  265.             
  266.             Set Money = ExeCutesql("select sum(金额) from 收入 where 日期  between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", "")
  267.                 A = Money.Fields(0)
  268.                 If IsNull(A) Then
  269.                    A = 0
  270.                 End If
  271.                 Label2.Caption = A
  272.                
  273.             Set Money1 = ExeCutesql("select sum(金额) from 支出 where 日期  between '" & Format(Riqi, "yyyy-mm") & "'and '" & Format(Riqi1, "yyyy-mm") & "'", "")
  274.                 B = Money1.Fields(0)
  275.                 If IsNull(B) Then
  276.                    B = 0
  277.                 End If
  278.                 Label8.Caption = B
  279.               
  280.                C = A - B
  281.                If C > 0 Then
  282.                   D = "富裕"
  283.                Else
  284.                  D = "超支"
  285.                End If
  286.                Label13.Caption = Year(Now) & "年" & Month(Now) & "月" & "," & "本月你" & D & C & "元!"
  287. End Sub