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

📄 frm_formula.frm

📁 VB开发的ERP系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frm_formula 
   AutoRedraw      =   -1  'True
   BackColor       =   &H00C0E0FA&
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "函数公式向导"
   ClientHeight    =   4020
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5715
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4020
   ScaleWidth      =   5715
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.ComboBox Combo3 
      Height          =   300
      Left            =   2400
      TabIndex        =   8
      Top             =   2580
      Width           =   855
   End
   Begin VB.ComboBox Combo2 
      Height          =   300
      Left            =   2400
      TabIndex        =   6
      Top             =   1860
      Width           =   975
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   2400
      TabIndex        =   3
      Top             =   1260
      Width           =   3075
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取  消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3330
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   3360
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      BackColor       =   &H00C0C0C0&
      Caption         =   "确  定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1170
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   3360
      Width           =   1215
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "Label4"
      Height          =   180
      Left            =   600
      TabIndex        =   7
      Top             =   2640
      Width           =   1500
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "Label3"
      Height          =   180
      Left            =   600
      TabIndex        =   5
      Top             =   1920
      Width           =   1500
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "Label2"
      Height          =   180
      Left            =   600
      TabIndex        =   4
      Top             =   1320
      Width           =   1500
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackColor       =   &H00C0E0FF&
      Caption         =   "Label1"
      Height          =   180
      Left            =   1680
      TabIndex        =   2
      Top             =   480
      Width           =   2100
   End
   Begin VB.Image Image1 
      Height          =   585
      Left            =   120
      Picture         =   "frm_formula.frx":0000
      Stretch         =   -1  'True
      Top             =   240
      Width           =   465
   End
End
Attribute VB_Name = "frm_formula"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'*************************************************
'The creator of this form is Squirrel.Song(宋树军)
'The fuction of this form is helping the users to make their formulation or equality with the
'The made time is oct 24th 2000
'*************************************************
'定义可变的控件数组
'Dim newcombo() As ComboBox
'Dim newlabel() As Label

Private Sub Command1_Click()
    Select Case UCase(song_temp)
    Case "JE_NCYE", "JE_QMYE"
        If Trim(Combo1.Text) = "" Then
            MsgBox "请选择会计科目 !!", vbInformation + vbOKOnly, "提示信息——华夏新达电子报表"
            Combo1.SetFocus
            Exit Sub
        End If
        If Trim(Combo2.Text) = "" Then
            MsgBox "请选择会计年度 !!", vbInformation + vbOKOnly, "提示信息——华夏新达电子报表"
            Combo2.SetFocus
            Exit Sub
        End If
        If Trim(Combo3.Text) = "" Then
            MsgBox "请选择会计月份 !!", vbInformation + vbOKOnly, "提示信息——华夏新达电子报表"
            Combo3.SetFocus
            Exit Sub
        End If
        song_temp = UCase(song_temp) & "(" + Chr(34) + Left(Combo1.Text, InStr(1, Combo1.Text, "-") - 1) + Chr(34) + "," + Chr(34) + Combo2.Text + Chr(34) + "," + Chr(34) + Combo3.Text + Chr(34) + ")"
        
    Case Default
        song_temp = ""
    End Select
    Unload Me
End Sub

Private Sub command2_Click()
    song_temp = ""
    Unload Me
End Sub

Private Sub Form_Load()
    
    Select Case UCase(song_temp)
    Case "JE_NCYE"
        Call ncsqms_sub
    Case "JE_QMYE"
        Call ncsqms_sub
    Case Else
        song_temp = ""
        Me.Hide
    End Select
End Sub

Private Sub ncsqms_sub() '年初数期末数函数的窗体生成
    Dim lrst_xtbm As ADODB.Recordset
    Dim ls_select As String
    Dim i As Integer
    Dim j As Long
    ' ReDim newcombo(1 To 3) As ComboBox
    'ReDim newlabel(1 To 2) As Label
    '        If Not newlabel(1) Is Nothing Then Set newlabel(1) = Nothing
    '        Set newlabel(1) = Controls.Add("VB.Label", "newlabel0")
    '        With newlabel(1)
    '            .Top = 400
    '            .BackStyle = 0
    '            .ForeColor = &HFF0000
    '            If song_temp = "NCYE" Then
    '                .Caption = "函数NCYE(年初数)参数向导"
    '            Else
    '                .Caption = "函数QMYE(期末数)参数向导"
    '            End If
    '            .FontSize = 14
    '            .AutoSize = True
    '            Me.Width = .Width * 2
    '            .Left = (Me.Width - .Width) / 2
    '            .Visible = True
    '            j = 600 + .Height
    '        End With
    '        If Not newlabel(2) Is Nothing Then Set newlabel(2) = Nothing
    '        Set newlabel(2) = Controls.Add("VB.Label", "newlabel1")
    '        With newlabel(2)
    '            .Top = newlabel(1).Top + newlabel(1).Height * 2.5
    '            .Caption = "请选择会计科目:"
    '            .FontSize = 10
    '            .BackStyle = 0
    '            .ForeColor = &HFF0000
    '            .AutoSize = True
    '            .Left = (Me.Width - .Width) / 2
    '            .Visible = True
    '            j = j + .Height
    '        End With
    '        If Not newcombo(1) Is Nothing Then Set newcombo(1) = Nothing
    '        Set newcombo(1) = Me.Controls.Add("VB.ComboBox", "NEWCOMBOBOX3")
    '        With newcombo(1)
    '            .Top = newlabel(2).Top + newlabel(2).Height * 1.5
    '            .Width = newlabel(2).Width * 1.5
    '            .FontSize = 10
    '            .Left = (Me.Width - .Width) / 2
    '            .Visible = True
    '            j = j + .Height
    '            Set lrst_xtbm = New ADODB.Recordset
    '            ls_select = "select ccode,cname from cwzz_acccode where cgrade=1  order by ccode"
    '            lrst_xtbm.Open ls_select, Cw_DataEnvi.dataconnect, adOpenStatic, adLockReadOnly, adCmdText
    '            If lrst_xtbm.RecordCount > 0 Then
    '                lrst_xtbm.MoveFirst
    '                Do While Not lrst_xtbm.EOF
    '                    .AddItem Trim(lrst_xtbm.Fields("ccode")) & "-" & Trim(lrst_xtbm.Fields("cname"))
    '                    lrst_xtbm.MoveNext
    '                Loop
    '                lrst_xtbm.Close
    '            End If
    '            Set lrst_xtbm = Nothing
    '        End With
    '        If Not newlabel(2) Is Nothing Then Set newlabel(2) = Nothing
    '        Set newlabel(2) = Controls.Add("VB.Label", "newlabel2")
    '        With newlabel(2)
    '            .Top = newcombo(1).Top + newcombo(1).Height * 1.5
    '            .Caption = "请选择会计年度:"
    '            .FontSize = 10
    '            .BackStyle = 0
    '            .ForeColor = &HFF0000
    '            .AutoSize = True
    '            .Left = (Me.Width - .Width) / 2
    '            .Visible = True
    '            j = j + .Height
    '        End With
    '        If Not newcombo(2) Is Nothing Then Set newcombo(2) = Nothing
    '        Set newcombo(2) = Controls.Add("VB.ComboBox", "NEWCOMBOBOX2")
    '        With newcombo(2)
    '            .Top = newlabel(2).Top + newlabel(2).Height * 1.5
    '            .Width = 700
    '            .Left = (Me.Width - .Width) / 2
    '            .Visible = True
    '            i = 1998
    '            Do While i <= Year(Date)
    '                .AddItem Trim(Str(i))
    '                i = i + 1
    '            Loop
    '            j = j + .Height
    '        End With
    '         If Not newlabel(2) Is Nothing Then Set newlabel(2) = Nothing
    '        Set newlabel(2) = Controls.Add("VB.Label", "newlabel3")
    '        With newlabel(2)
    '            .Top = newcombo(2).Top + newcombo(2).Height * 1.5
    '            .Caption = "请选择会计月份:"
    '            .FontSize = 10
    '            .BackStyle = 0
    '            .ForeColor = &HFF0000
    '            .AutoSize = True
    '            .Left = (Me.Width - .Width) / 2
    '            .Visible = True
    '            j = j + .Height
    '        End With
    '        If Not newcombo(3) Is Nothing Then Set newcombo(3) = Nothing
    '        Set newcombo(3) = Controls.Add("VB.ComboBox", "NEWCOMBOBOX1")
    '        With newcombo(3)
    '            .Top = newlabel(2).Top + newlabel(2).Height * 1.5
    '            .Width = 600
    '            .Left = (Me.Width - .Width) / 2
    '            .Visible = True
    '            i = 1
    '            Do While i < 13
    '                If i >= 10 Then
    '                    .AddItem Trim(Str(i))
    '                Else
    '                    .AddItem Trim("0" & Trim(Str(i)))
    '                End If
    '                i = i + 1
    '            Loop
    '            j = j + .Height
    '        End With
    '        Me.Height = j + Command1.Height * 5
    '        With Command1
    '            .Top = Me.Height - .Height * 2
    '            .Left = (Me.Width - .Width * 2) / 3
    '        End With
    '        With Command2
    '            .Top = Me.Height - .Height * 2
    '            .Left = Command1.Left * 2 + Command1.Width
    '        End With
    '        Image1.Top = (Me.Height - Image1.Height) / 2
    '        Image1.Left = 600
    '        Me.Top = (Screen.Height - Me.Height) / 2
    '        Me.Left = (Screen.Width - Me.Width) / 2
    With Label1
        If song_temp = "JE_NCYE" Then
            .Caption = "函数NCYE(年初数)参数向导"
        Else
            .Caption = "函数QMYE(期末数)参数向导"
        End If
        .FontSize = 14
        .AutoSize = True
        .Visible = True
    End With
    
    With Label2
        .Caption = "请选择会计科目:"
        .FontSize = 10
        .BackStyle = 0
        .ForeColor = &HFF0000
        .AutoSize = True
        .Visible = True
    End With
    With Combo1
        .FontSize = 10
        .Visible = True
        Set lrst_xtbm = New ADODB.Recordset
        ls_select = "select ccode,cname from cwzz_acccode  order by ccode"
        lrst_xtbm.Open ls_select, Cw_DataEnvi.dataconnect, adOpenStatic, adLockReadOnly, adCmdText
        If lrst_xtbm.RecordCount > 0 Then
            lrst_xtbm.MoveFirst
            Do While Not lrst_xtbm.EOF
                .AddItem Trim(lrst_xtbm.Fields("ccode")) & "-" & Trim(lrst_xtbm.Fields("cname"))
                lrst_xtbm.MoveNext
            Loop
            lrst_xtbm.Close
        End If
        Set lrst_xtbm = Nothing
    End With
    With Label3
        .Caption = "请选择会计年度:"
        .FontSize = 10
        .BackStyle = 0
        .ForeColor = &HFF0000
        .AutoSize = True
        .Visible = True
    End With
    With Combo2
        .Visible = True
        i = 1998
        Do While i <= Year(Date)
            .AddItem Trim(Str(i))
            i = i + 1
        Loop
    End With
    With Label4
        .Caption = "请选择会计月份:"
        .FontSize = 10
        .BackStyle = 0
        .ForeColor = &HFF0000
        .AutoSize = True
        .Visible = True
    End With
    With Combo3
        .Visible = True
        i = 1
        Do While i < 13
            If i >= 10 Then
                .AddItem Trim(Str(i))
            Else
                .AddItem Trim("0" & Trim(Str(i)))
            End If
            i = i + 1
        Loop
    End With
End Sub

⌨️ 快捷键说明

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