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

📄 dt_srfcx.frm

📁 该系统为酒店日常管理提供了很大的方便
💻 FRM
📖 第 1 页 / 共 2 页
字号:
   End
   Begin VB.Label frm_msg 
      Alignment       =   1  'Right Justify
      ForeColor       =   &H00C00000&
      Height          =   240
      Left            =   3120
      TabIndex        =   5
      Top             =   60
      Visible         =   0   'False
      Width           =   2595
   End
End
Attribute VB_Name = "dt_srfcx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim t_tbname As String
Dim t_bt As String          '存储列表显示的表头
Dim t_fields As Variant     '存储列表显示的字段名
Dim t_fdxs As Variant       '表示显示列是否由代码转换成文字
Dim t_fdcounts As Integer   '表示列表所显示的字段的个数
 

'**************************************************************************************************
'*  功    能 : 明细列表的显示
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub tPxs_SRFCX()

    Dim temp_srf As Recordset
    Dim temp_srfHJ As Recordset
    Dim temp_rq_s As Date
    Dim temp_rq_e As Date
    Dim temp_day As Integer
    
    If Trim(m_month.Text) = "" Then
        temp_rq_s = Format(DateSerial(CInt(m_year.Text), 1, 1), "yyyy-mm-dd")
        temp_rq_e = Format(DateSerial(CInt(m_year.Text), 12, 31), "yyyy-mm-dd")
    Else
        temp_rq_s = Format(DateSerial(CInt(m_year.Text), CInt(m_month.Text), 1), "yyyy-mm-dd")
        temp_day = DateSerial(CInt(m_year.Text), CInt(m_month.Text) + 1, 1) - DateSerial(CInt(m_year.Text), CInt(m_month.Text), 1)
        temp_rq_e = Format(DateSerial(CInt(m_year.Text), CInt(m_month.Text), temp_day), "yyyy-mm-dd")
    End If
    
    lb_name.Caption = Trim(m_year.Text) & "年" & IIf(Trim(m_month.Text) = "", "", Trim(m_month.Text) & "月") & "双人间住单人客房一览表"
    
    Set temp_srfHJ = PUB_data.OpenRecordset("SELECT SUM(SF_FYS) AS FYS, SUM(SF_ZZS) AS ZZS, SUM(SF_DRS) AS DRS FROM DT_SRFTJ WHERE RQ BETWEEN #" & temp_rq_s & "# AND #" & temp_rq_e & "#", 4, 0, 2)
    If Not temp_srfHJ.BOF Then
        temp_srfHJ.MoveLast
        lb_fys.Caption = IIf(IsNull(temp_srfHJ.Fields("FYS")), 0, temp_srfHJ.Fields("FYS"))
        lb_zzs.Caption = IIf(IsNull(temp_srfHJ.Fields("ZZS")), 0, temp_srfHJ.Fields("ZZS"))
        lb_drs.Caption = IIf(IsNull(temp_srfHJ.Fields("DRS")), 0, temp_srfHJ.Fields("DRS"))
    Else
        lb_fys.Caption = 0
        lb_zzs.Caption = 0
        lb_drs.Caption = 0
    End If
    temp_srfHJ.Close
    
    Set temp_srf = PUB_data.OpenRecordset("SELECT * FROM DT_SRFTJ WHERE RQ BETWEEN #" & temp_rq_s & "# AND #" & temp_rq_e & "# ORDER BY RQ", 4, 0, 2)
    If Not temp_srf.BOF Then
        temp_srf.MoveLast
    End If
    
    Call flex_refresh(gd1, t_bt, temp_srf, t_fields, t_fdcounts, t_fdxs)
    lb_jls.Caption = gd1.Rows - 1
    temp_srf.Close

End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub flex_refresh(temp_gd As MSFlexGrid, temp_bt As String, temp_rec As Recordset, temp_fields As Variant, temp_fdcounts As Integer, temp_fdxs As Variant)
    Call Flex_full(temp_gd, temp_bt, temp_rec, temp_fields, temp_fdcounts - 1, temp_fdxs)
    temp_gd.Refresh
End Sub



'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub CMD_EXIT_Click()
    Unload Me
End Sub

Private Sub Form_Activate()
    m_year.SetFocus
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    frm_msg.Caption = ""
    frm_msg.Visible = False
    If KeyCode = vbKeyEscape Then
        Call CMD_EXIT_Click
    End If
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub Form_Load()

    dt_srfcx.KeyPreview = True

    frm_msg.Visible = True
    frm_msg.Caption = ""
    
    m_year.Text = year(Date)
    m_month.Text = month(Date)

    '明细显示字段设置
    t_fields = Array("RQ", "SF_FYS", "SF_ZZS", "SF_DRS") '设置显示字段
    t_fdxs = Array(0, 0, 0, 0) '设置显示字段
    t_bt = "^日  期        |>房 源 数    |>在 住 数    |>单 人 数    "   '设置显示表头格式
    t_fdcounts = 4
    
    Call tPxs_SRFCX
    
End Sub


Private Sub gd1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then
        CMD_print.SetFocus
    End If
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_year_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then
        m_month.SetFocus
    End If
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_year_LostFocus()
    Dim temp_ft As Boolean
    
    frm_msg.Visible = False
    frm_msg.Caption = ""
    
    temp_ft = PUB_SZJY(m_year, frm_msg)
    If temp_ft Then
        If CInt(m_year.Text) >= year(LoadResString(SYS_START)) And CInt(m_year.Text) <= year(Date) Then
        Else
            frm_msg.Visible = True
            frm_msg.Caption = "年份范围应在 " & year(LoadResString(SYS_START)) & " 至 " & year(Date) & " 之间"
            m_year.Text = year(Date)
        End If
    End If
    
    Call tPxs_SRFCX
End Sub
'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_month_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn Then
        gd1.SetFocus
    End If
        
End Sub

'**************************************************************************************************
'*  功    能 :
'*  作    者 : 梁卫
'*  作成日期 : 1999.03.18
'*  修改日期 : 1999.03.18
'**************************************************************************************************
Private Sub m_month_LostFocus()
    Dim temp_ft As Boolean
    
    frm_msg.Visible = False
    frm_msg.Caption = ""
    
    If Trim(m_month.Text) = "" Then
    Else
        temp_ft = PUB_SZJY(m_month, frm_msg)
        If temp_ft Then
            If m_year.Text <> year(Date) Then
                If CInt(m_month.Text) >= 1 And CInt(m_month.Text) <= 12 Then
                Else
                    frm_msg.Visible = True
                    frm_msg.Caption = "月份范围应在 1 至 12 之间"
                    m_month.Text = month(Date)
                End If
            Else
                If CInt(m_month.Text) >= 1 And CInt(m_month.Text) <= month(Date) Then
                Else
                    frm_msg.Visible = True
                    frm_msg.Caption = "月份范围应在 1 至 " & month(Date) & " 之间"
                    m_month.Text = month(Date)
                End If
            End If
        
        End If
    End If
    
    Call tPxs_SRFCX
End Sub

⌨️ 快捷键说明

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