📄 frmhistory.frm
字号:
Caption = "点,订单数为:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2160
TabIndex = 17
Top = 960
Width = 1695
End
Begin VB.Label Label8
Alignment = 2 'Center
Caption = "月"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4440
TabIndex = 16
Top = 480
Width = 375
End
Begin VB.Label Label7
Alignment = 2 'Center
Caption = "年"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3600
TabIndex = 15
Top = 480
Width = 375
End
Begin VB.Label Label6
Alignment = 2 'Center
Caption = "月 至"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 2040
TabIndex = 14
Top = 480
Width = 975
End
Begin VB.Label Label5
Alignment = 2 'Center
Caption = "年"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1200
TabIndex = 13
Top = 480
Width = 375
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "以上年月段"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 12
Top = 960
Width = 1335
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "从"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 11
Top = 480
Width = 375
End
End
Attribute VB_Name = "frmHistory"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim strDateFrom As String
Dim strDateTo As String
Dim strTimeFrom As String
Dim strTimeTo As String
Private Sub GetData()
strDateFrom = Trim(txtYearFrom.Text) + "-" + TwoDigit(Val(txtMonthFrom.Text)) + "-01"
strDateTo = Trim(txtYearTo.Text) + "-" + TwoDigit(Val(txtMonthTo.Text)) + "-31"
strDateTo = GetMonthEnd(strDateTo)
strTimeFrom = TwoDigit(Val(txtHour.Text)) + ":00:00"
strTimeTo = TwoDigit(Val(txtHour.Text)) + ":59:59"
End Sub
Private Sub cmdClear_Click()
cmdDel.Enabled = False
txtYearFrom.Text = ""
txtYearTo.Text = ""
txtMonthFrom.Text = ""
txtMonthTo.Text = ""
txtHour.Text = ""
txtItems.Text = ""
End Sub
Private Sub cmdDel_Click()
Dim nRet As Integer
On Error Resume Next 'CallerID
With frmMain.DG_Nows
If .Visible = False Or .Caption <> "历史订单" Then
cmdDel.Enabled = False
Exit Sub
End If
End With
nRet = MsgBox("确信删除" + ts(DAYS_RESERVED) + "天之前的历史订单吗?", vbQuestion + vbYesNo, "提示")
If nRet = 7 Then Exit Sub
DeleteData frmMain.AdodcCaller, 0
frmMain.Display_History
AdjustNumber frmMain.AdodcCaller, 1
cmdDel.Enabled = False
End Sub
Private Sub cmdInqery1_Click()
On Error Resume Next 'CallerID
If txtYearFrom = "" Or txtYearTo = "" Or txtMonthFrom = "" Or txtMonthTo = "" Then
MsgBox "请输入待查询的起止年月!", vbExclamation + vbOKOnly, "提示"
txtYearFrom.SetFocus
Exit Sub
End If
GetData
With frmMain.AdodcCaller
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _
strDataHistory + ";Persist Security Info=False"
.CommandType = adCmdUnknown
.RecordSource = "select * from DayCounts where [Date]>='" + _
strDateFrom + "' and [Date]<='" + _
strDateTo + "' order by [ID]"
.Refresh
With .Recordset
If .RecordCount > 0 And Date - CDate(strDateTo) > DAYS_RESERVED Then
cmdDel.Enabled = True
Else
cmdDel.Enabled = False
End If
End With
End With
End Sub
Private Sub cmdInqery2_Click()
On Error Resume Next 'CallerID
cmdDel.Enabled = False
If txtYearFrom = "" Or txtYearTo = "" Or txtMonthFrom = "" Or txtMonthTo = "" Or txtHour = "" Then
MsgBox "请输入待查询的起止年月及小时!", vbExclamation + vbOKOnly, "提示"
txtYearFrom.SetFocus
Exit Sub
End If
GetData
With frmMain.AdodcCaller
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _
strDataHistory + ";Persist Security Info=False"
.CommandType = adCmdUnknown
.RecordSource = "select * from DayCounts where [Date]>='" + _
strDateFrom + "' and [Date]<='" + _
strDateTo + "' and [Time]>='" + strTimeFrom + "' and " + _
"[Time]<='" + strTimeTo + "' order by [ID]"
.Refresh
If .Recordset.RecordCount > 0 Then
txtItems.Text = .Recordset.RecordCount
Else
txtItems.Text = 0
End If
End With
End Sub
Private Sub cmdQuit_Click()
Unload Me
End Sub
Private Sub Form_Load()
frmMain.Display_History
txtYearFrom.Text = Year(Date)
txtYearTo.Text = Year(Date)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -