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

家庭/个人应用

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Begin VB.Form frm_date 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "选择月份"
  5.    ClientHeight    =   1755
  6.    ClientLeft      =   45
  7.    ClientTop       =   330
  8.    ClientWidth     =   3690
  9.    Icon            =   "frm_date.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   1755
  14.    ScaleWidth      =   3690
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   2  '屏幕中心
  17.    Begin VB.CommandButton Command1 
  18.       Caption         =   "确定"
  19.       Height          =   375
  20.       Left            =   1440
  21.       TabIndex        =   3
  22.       Top             =   1200
  23.       Width           =   735
  24.    End
  25.    Begin VB.ComboBox Combo2 
  26.       BeginProperty Font 
  27.          Name            =   "宋体"
  28.          Size            =   10.5
  29.          Charset         =   134
  30.          Weight          =   400
  31.          Underline       =   0   'False
  32.          Italic          =   0   'False
  33.          Strikethrough   =   0   'False
  34.       EndProperty
  35.       Height          =   330
  36.       ItemData        =   "frm_date.frx":030A
  37.       Left            =   2040
  38.       List            =   "frm_date.frx":0332
  39.       Style           =   2  'Dropdown List
  40.       TabIndex        =   2
  41.       Top             =   600
  42.       Width           =   975
  43.    End
  44.    Begin VB.ComboBox Combo1 
  45.       BeginProperty Font 
  46.          Name            =   "宋体"
  47.          Size            =   10.5
  48.          Charset         =   134
  49.          Weight          =   400
  50.          Underline       =   0   'False
  51.          Italic          =   0   'False
  52.          Strikethrough   =   0   'False
  53.       EndProperty
  54.       Height          =   330
  55.       Left            =   480
  56.       Style           =   2  'Dropdown List
  57.       TabIndex        =   1
  58.       Top             =   600
  59.       Width           =   1095
  60.    End
  61.    Begin VB.Label Label3 
  62.       BackStyle       =   0  'Transparent
  63.       Caption         =   "月"
  64.       BeginProperty Font 
  65.          Name            =   "宋体"
  66.          Size            =   12
  67.          Charset         =   134
  68.          Weight          =   400
  69.          Underline       =   0   'False
  70.          Italic          =   0   'False
  71.          Strikethrough   =   0   'False
  72.       EndProperty
  73.       Height          =   375
  74.       Left            =   3120
  75.       TabIndex        =   5
  76.       Top             =   600
  77.       Width           =   375
  78.    End
  79.    Begin VB.Label Label2 
  80.       BackStyle       =   0  'Transparent
  81.       Caption         =   "年"
  82.       BeginProperty Font 
  83.          Name            =   "宋体"
  84.          Size            =   12
  85.          Charset         =   134
  86.          Weight          =   400
  87.          Underline       =   0   'False
  88.          Italic          =   0   'False
  89.          Strikethrough   =   0   'False
  90.       EndProperty
  91.       Height          =   255
  92.       Left            =   1680
  93.       TabIndex        =   4
  94.       Top             =   600
  95.       Width           =   495
  96.    End
  97.    Begin VB.Label Label1 
  98.       BackStyle       =   0  'Transparent
  99.       Caption         =   "请选择月份:"
  100.       BeginProperty Font 
  101.          Name            =   "宋体"
  102.          Size            =   10.5
  103.          Charset         =   134
  104.          Weight          =   400
  105.          Underline       =   0   'False
  106.          Italic          =   0   'False
  107.          Strikethrough   =   0   'False
  108.       EndProperty
  109.       Height          =   255
  110.       Left            =   240
  111.       TabIndex        =   0
  112.       Top             =   240
  113.       Width           =   1455
  114.    End
  115. End
  116. Attribute VB_Name = "frm_date"
  117. Attribute VB_GlobalNameSpace = False
  118. Attribute VB_Creatable = False
  119. Attribute VB_PredeclaredId = True
  120. Attribute VB_Exposed = False
  121. Dim Mydb As New ADODB.Recordset
  122. Dim Riqi, Riqi1, Year1, Month As String
  123. Private Sub Command1_Click()
  124.             'Dim Riqi, Riqi1, Year, Month As String
  125.             If Combo1.Text = "" Then
  126.                MsgBox "请选择年份!", vbOKOnly + 32, "注意!"
  127.             Else
  128.                If Combo2.Text = "" Then
  129.                   MsgBox "请选择月份!", vbOKOnly + 32, "注意!"
  130.                Else
  131.                   AA = True
  132.                   Year1 = Combo1.Text
  133.                   Month = Combo2.Text
  134.                   Riqi = Year1 & "-" & Month
  135.                   Riqi1 = Year1 & "-" & Month + 1
  136.                   'MsgBox Riqi
  137.                   'Set Mydb = ExeCutesql("select * from 收入 where 日期 between '" & Riqi & "' and '" & Riqi1 & "' ", "")
  138.                   Cdate1 = Format(Riqi, "yyyy-mm")
  139.                   Cdate2 = Format(Riqi1, "yyyy-mm")
  140.                   Unload Me
  141.                End If
  142.             End If
  143.             
  144. End Sub
  145. Private Sub Form_Load()
  146.             Dim A As Integer
  147.             A = 2000
  148.             For I = 2000 To Int(Year(Now))
  149.                 Combo1.AddItem A
  150.                 A = A + 1
  151.             Next I
  152. End Sub