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

📄 frmselectkmprint.frm

📁 一个用VB写的财务软件源码
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmSelectKmPrint 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "科目选择"
   ClientHeight    =   1260
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4665
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1260
   ScaleWidth      =   4665
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton Command2 
      Caption         =   ".."
      Height          =   195
      Left            =   3105
      TabIndex        =   13
      Top             =   225
      Visible         =   0   'False
      Width           =   195
   End
   Begin VB.CommandButton Command1 
      Caption         =   ".."
      Height          =   195
      Left            =   1440
      TabIndex        =   12
      Top             =   225
      Visible         =   0   'False
      Width           =   195
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   285
      Left            =   3645
      TabIndex        =   11
      Top             =   810
      Width           =   825
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "确定"
      Height          =   285
      Left            =   3645
      TabIndex        =   10
      Top             =   225
      Width           =   825
   End
   Begin MSComCtl2.UpDown UpDown2 
      Height          =   270
      Left            =   3105
      TabIndex        =   8
      Top             =   810
      Width           =   270
      _ExtentX        =   423
      _ExtentY        =   476
      _Version        =   393216
      Value           =   1
      BuddyControl    =   "txtEndJc"
      BuddyDispid     =   196614
      OrigLeft        =   3420
      OrigTop         =   810
      OrigRight       =   3690
      OrigBottom      =   1275
      Min             =   1
      SyncBuddy       =   -1  'True
      BuddyProperty   =   65547
      Enabled         =   -1  'True
   End
   Begin VB.TextBox txtEndJc 
      Enabled         =   0   'False
      Height          =   270
      Left            =   2295
      TabIndex        =   7
      Text            =   "1"
      Top             =   810
      Width           =   780
   End
   Begin MSComCtl2.UpDown UpDown1 
      Height          =   270
      Left            =   1395
      TabIndex        =   6
      Top             =   810
      Width           =   270
      _ExtentX        =   423
      _ExtentY        =   476
      _Version        =   393216
      Value           =   1
      BuddyControl    =   "txtStartJc"
      BuddyDispid     =   196616
      OrigLeft        =   1620
      OrigTop         =   675
      OrigRight       =   1890
      OrigBottom      =   1095
      Min             =   1
      SyncBuddy       =   -1  'True
      BuddyProperty   =   65547
      Enabled         =   -1  'True
   End
   Begin VB.TextBox txtStartJc 
      Enabled         =   0   'False
      Height          =   270
      Left            =   765
      TabIndex        =   2
      Text            =   "1"
      Top             =   810
      Width           =   645
   End
   Begin VB.TextBox txtEndKm 
      Height          =   285
      Left            =   2295
      TabIndex        =   1
      Top             =   180
      Width           =   1050
   End
   Begin VB.TextBox txtStartKm 
      Height          =   270
      Left            =   765
      TabIndex        =   0
      Top             =   180
      Width           =   915
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "——"
      Height          =   180
      Left            =   1800
      TabIndex        =   9
      Top             =   855
      Width           =   360
   End
   Begin VB.Label Label3 
      Caption         =   "级次:"
      Height          =   195
      Left            =   45
      TabIndex        =   5
      Top             =   855
      Width           =   555
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "——"
      Height          =   180
      Left            =   1800
      TabIndex        =   4
      Top             =   225
      Width           =   360
   End
   Begin VB.Label Label1 
      Caption         =   "科目:"
      Height          =   195
      Left            =   90
      TabIndex        =   3
      Top             =   225
      Width           =   555
   End
End
Attribute VB_Name = "frmSelectKmPrint"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public Ok As Boolean
Public sWhere As String

Private Sub cmdCancel_Click()
Ok = False
Me.Hide
End Sub

Private Sub cmdOk_Click()
Dim rSt As New ADODB.Recordset
Ok = False
If UpDown1.value > UpDown2.value Then
    MsgBox "开始级次必须大于终止级次!"
    Exit Sub
End If
If Trim(txtStartKm) = "" Then
    MsgBox "必须有开始科目!"
    Exit Sub
Else
    rSt.Open "Select kmmc from tZW_km" + glo.sOperateYear + " where kmdm='" + Trim(txtStartKm) + "'", glo.cnnMain, adOpenKeyset, adLockPessimistic
    If rSt.EOF And rSt.BOF Then
        MsgBox "无此开始科目!"
        Exit Sub
    End If
    rSt.Close
End If
If Trim(txtEndKm) = "" Then
    txtEndKm = txtStartKm
    sWhere = "kmdm >='" + Trim(txtStartKm) + "' and kmjc>=" + CStr(UpDown1.value) + " and kmjc<=" + CStr(UpDown2.value)
Else
    rSt.Open "Select kmmc from tZW_km" + glo.sOperateYear + " where kmdm='" + Trim(txtEndKm) + "'", glo.cnnMain, adOpenKeyset, adLockPessimistic
    If rSt.EOF And rSt.BOF Then
        MsgBox "无此终止科目!"
        Exit Sub
    End If
    rSt.Close
     If IsEndSubject(txtEndKm) Then
     sWhere = "kmdm>='" + Trim(txtStartKm) + "' and kmdm<='" + Trim(txtEndKm) + "' or kmdm = '" + Trim(txtEndKm) + "' And KmJc >= " + CStr(UpDown1.value) + " And KmJc <= " + CStr(UpDown2.value)
   
     Else
    sWhere = "kmdm>='" + Trim(txtStartKm) + "' and kmdm<='" + Trim(txtEndKm) + "' or kmdm like '" + Trim(txtEndKm) + "-%' And KmJc >= " + CStr(UpDown1.value) + " And KmJc <= " + CStr(UpDown2.value)
     End If
End If

Ok = True
Me.Hide

End Sub

Private Sub Command1_Click()
frmUSU_KmHelp.ubSelAll = True
frmUSU_KmHelp.Show 1
If frmUSU_KmHelp.Valid Then
    txtStartKm = frmUSU_KmHelp.SubjectCode
End If
Unload frmUSU_KmHelp
End Sub

Private Sub Command2_Click()
frmUSU_KmHelp.ubSelAll = True
frmUSU_KmHelp.Show 1
If frmUSU_KmHelp.Valid Then
    txtEndKm = frmUSU_KmHelp.SubjectCode
End If
Unload frmUSU_KmHelp
End Sub

Private Sub form_load()
Dim MaxJc As Integer
MaxJc = uGetMaxJc()
UpDown1.Max = MaxJc
UpDown2.Max = MaxJc
UpDown2.value = MaxJc
txtStartKm.text = GetMinKmdm()
txtEndKm.text = GetMaxKmdm()
Ok = False
End Sub

Private Sub txtEndKm_GotFocus()
Command2.Visible = True
Command1.Visible = False
End Sub

Private Sub txtEndKm_LostFocus()
'Command2.Visible = False
End Sub

Private Sub txtStartKm_GotFocus()
Command1.Visible = True
Command2.Visible = False
End Sub

Private Sub txtStartKm_LostFocus()
'Command1.Visible = False
End Sub

⌨️ 快捷键说明

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