⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmmsg.frm

📁 用VB实现连接oracle817数据月报数输入并统计
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frm_lrsj 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "全省费用登记系统"
   ClientHeight    =   4695
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   7470
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   ScaleHeight     =   4695
   ScaleWidth      =   7470
   StartUpPosition =   2  '屏幕中心
   Begin VB.Timer Timer1 
      Interval        =   1
      Left            =   0
      Top             =   0
   End
   Begin VB.CommandButton Command1 
      Caption         =   "退  出"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   1
      Left            =   3630
      TabIndex        =   6
      Top             =   3450
      Width           =   1815
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确  定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   0
      Left            =   1320
      TabIndex        =   5
      Top             =   3450
      Width           =   1815
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   1
      Left            =   3390
      TabIndex        =   4
      Top             =   1740
      Width           =   1155
   End
   Begin VB.TextBox Text1 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   0
      Left            =   3390
      TabIndex        =   3
      Top             =   1140
      Width           =   1155
   End
   Begin MSComctlLib.StatusBar StatusBar1 
      Align           =   2  'Align Bottom
      Height          =   540
      Left            =   0
      TabIndex        =   9
      Top             =   4155
      Width           =   7470
      _ExtentX        =   13176
      _ExtentY        =   953
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   2
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            AutoSize        =   1
            Object.Width           =   6535
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Alignment       =   1
            AutoSize        =   1
            Object.Width           =   6535
         EndProperty
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label lblYsnd 
      Caption         =   "月"
      BeginProperty Font 
         Name            =   "华文中宋"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Index           =   2
      Left            =   4590
      TabIndex        =   8
      Top             =   1770
      Width           =   375
   End
   Begin VB.Label lblYsnd 
      Caption         =   "年"
      BeginProperty Font 
         Name            =   "华文中宋"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Index           =   1
      Left            =   4590
      TabIndex        =   7
      Top             =   1170
      Width           =   375
   End
   Begin VB.Label Label1 
      Caption         =   "    全省月费用登记"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   465
      Left            =   1740
      TabIndex        =   2
      Top             =   210
      Width           =   3915
   End
   Begin VB.Label lblYsyf 
      Caption         =   "请输入月份(如:12):"
      BeginProperty Font 
         Name            =   "华文中宋"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Index           =   1
      Left            =   390
      TabIndex        =   1
      Top             =   1770
      Width           =   2985
   End
   Begin VB.Label lblYsnd 
      Caption         =   "请输入年度(如:2002):"
      BeginProperty Font 
         Name            =   "华文中宋"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Index           =   0
      Left            =   390
      TabIndex        =   0
      Top             =   1140
      Width           =   2985
   End
End
Attribute VB_Name = "frm_lrsj"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click(Index As Integer)
Dim tmpYd As Long
Dim tmpYf As Long
Dim strSql As String
Dim varRs As Variant
Dim blnHave As Boolean
Dim bHave   As Boolean

bHave = False
                   
Select Case Index
       Case 0
              If gNumVal(Text1(0).Text) < 2001 Or gNumVal(Text1(0).Text) > 2100 Then
                 
                 SM "输入的年度超出了范围!请重输!"
                 Text1(0).SetFocus
                
              Else
                If gNumVal(Text1(1).Text) < 1 Or gNumVal(Text1(1).Text) > 12 Then
                    SM "输入的月份超出了范围!请重输!"
                    Text1(1).SetFocus
                
                Else
                   tmpYd = gNumVal(Text1(0).Text)
                   tmpYf = gNumVal(Text1(1).Text)
                   bHave = False
 
                   strSql = "SELECT VHZXH FROM YB.B_YBHZ " & _
                             "WHERE NYBND=" & tmpYd & " AND NYBYF=" & tmpYf
                    
                    If Not fGetRS(strSql, varRs, blnHave) Then
                       Command1(0).SetFocus
                       Exit Sub
                    Else
                        If blnHave Then
                           SM tmpYd & "年" & tmpYf & "月的费用已经登记注册!"
                           Text1(1).SetFocus
                           Exit Sub
                        Else
                           gYbhz.HZXH = Trim(GetHzxh)
                           If Len(gYbhz.HZXH) > 1 Then
                                gYbhz.YBND = tmpYd
                                gYbhz.YBYF = tmpYf
                                gYbhz.ZBRDH = gOper.CZYDH
                                gYbhz.DJRQ = GetServerTime
                                Unload frm_lrsj
                                frmMain.Show vbModal
                           
                           Else
                                Command1(0).SetFocus
                                               
                           End If
                           
                        End If
                    End If
                End If
              End If
                   
       Case 1
            End

End Select

End Sub

Private Sub Form_Load()
StatusBar1.Panels(1).Text = "人员:" & gOper.CZYMC
StatusBar1.Panels(2).Text = "时间:" & Time
End Sub


Private Sub Text1_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
Select Case Index
       Case 0
            If KeyCode = vbKeyReturn Then
              If gNumVal(Text1(0).Text) < 2001 Or gNumVal(Text1(0).Text) > 2100 Then
                 SM "输入的年度超出了范围!请重输!"
                 Text1(0).SetFocus
              
              Else
                 Text1(1).SetFocus
                 
              End If
            End If
                   
       Case 1
            If KeyCode = vbKeyReturn Then
              If gNumVal(Text1(1).Text) < 1 Or gNumVal(Text1(1).Text) > 12 Then
                 SM "输入的月份超出了范围!请重输!"
                 Text1(1).SetFocus
                 
              Else
                 Command1(0).SetFocus
                 
              End If
            End If
           
End Select

End Sub

Private Sub Timer1_Timer()
StatusBar1.Panels(2).Text = "时间:" & Time
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -