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

📄 frmsavedate.frm

📁 一个功能比较完善的远程抄表软件
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmSaveDate 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "保存数据"
   ClientHeight    =   1755
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4305
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1755
   ScaleWidth      =   4305
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Height          =   375
      Left            =   600
      TabIndex        =   3
      Top             =   1200
      Width           =   1335
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   375
      Left            =   2280
      TabIndex        =   2
      Top             =   1200
      Width           =   1335
   End
   Begin VB.OptionButton optLastDate 
      Caption         =   "最近采集日期"
      Height          =   375
      Left            =   360
      TabIndex        =   1
      Top             =   240
      Width           =   3495
   End
   Begin VB.OptionButton optCurDate 
      Caption         =   "当前日期"
      Height          =   375
      Left            =   360
      TabIndex        =   0
      Top             =   600
      Value           =   -1  'True
      Width           =   3495
   End
End
Attribute VB_Name = "frmSaveDate"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2007/07/09
'描    述:CBB三表户外计量系统 Ver 5.2
'网    站:http://www.Mndsoft.com/  (VB6源码博客)
'网    站:http://www.VbDnet.com/   (VB.NET源码博客,主要基于.NET2005)
'e-mail  :Mndsoft@163.com
'e-mail  :Mndsoft@126.com
'OICQ    :88382850
'          如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Dim v_LastDate As Date
Sub initDate()
Dim rcDate As Recordset
Dim SQL As String

    SQL = "select distinct max(Date) as maxDate from UserData "
    Set rcDate = dbCbb.OpenRecordset(SQL)
    If rcDate.EOF Or rcDate.RecordCount <= 0 Then
        optLastDate.Value = False
        optLastDate.Enabled = False
        optCurDate.Enabled = True
        optCurDate.Value = True
        Exit Sub
    Else
        optLastDate.Caption = optLastDate.Caption + "(" + Format(rcDate!maxDate, "yyyy-mm-dd") + ")"
        If IsNull(rcDate!maxDate) Then
            optLastDate.Value = False
            optLastDate.Enabled = False
            optCurDate.Enabled = True
            optCurDate.Value = True
        Else
            v_LastDate = rcDate!maxDate
        End If
    End If
End Sub


Private Sub chkDate_Click()
    If chkDate.Value = 1 Then
        cmbDate.Enabled = False
    Else
        cmbDate.Enabled = True
    End If
End Sub

Private Sub cmdCancel_Click()
    g_IsSaveData = False
    Unload frmSaveDate
End Sub

Private Sub cmdOK_Click()
    If optCurDate.Value Then
        g_SelDate = Date
    Else
        g_SelDate = v_LastDate
    End If
    g_IsSaveData = True
    Unload frmSaveDate
End Sub

Private Sub Form_Load()
    If UBound(curForm) > 0 Then
        curForm(UBound(curForm)).Enabled = False
    End If
    ReDim Preserve curForm(UBound(curForm) + 1)
    Set curForm(UBound(curForm)) = Me
    
    optCurDate.Caption = optCurDate.Caption + "(" + Format(Date, "yyyy-mm-dd") & ")"
    initDate
    g_SelDate = 0
End Sub


Private Sub Form_Unload(Cancel As Integer)
    ReDim Preserve curForm(UBound(curForm) - 1)
    If UBound(curForm) > 0 Then
        curForm(UBound(curForm)).Enabled = True
    End If

End Sub

⌨️ 快捷键说明

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