📄 frmxh.frm
字号:
VERSION 5.00
Begin VB.Form frmxh
BorderStyle = 3 'Fixed Dialog
Caption = "数据部分销毁"
ClientHeight = 4260
ClientLeft = 45
ClientTop = 330
ClientWidth = 6015
Icon = "frmxh.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4260
ScaleWidth = 6015
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command3
Caption = "退出"
Height = 375
Left = 4560
TabIndex = 4
Top = 3720
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "下一步"
Height = 375
Left = 3300
TabIndex = 3
Top = 3720
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "上一步"
Height = 375
Left = 2040
TabIndex = 2
Top = 3720
Visible = 0 'False
Width = 1095
End
Begin VB.Frame Frame1
Caption = "请选择数据年度"
Height = 2895
Left = 2160
TabIndex = 0
Top = 240
Width = 3615
Begin VB.OptionButton Option2
Caption = "销毁出樯日期在2001年度的且部数据"
Height = 495
Left = 480
TabIndex = 6
Top = 1680
Visible = 0 'False
Width = 2775
End
Begin VB.OptionButton Option1
Caption = "销毁出票日期在2001年度且现已到期数据"
Height = 375
Left = 480
TabIndex = 5
Top = 840
Visible = 0 'False
Width = 2775
End
Begin VB.ComboBox Combo1
Height = 300
ItemData = "frmxh.frx":000C
Left = 1680
List = "frmxh.frx":00A6
TabIndex = 1
Top = 1320
Width = 1335
End
Begin VB.Label Label1
Caption = "数据年度"
Height = 255
Left = 840
TabIndex = 7
Top = 1365
Width = 855
End
End
Begin VB.Image Image2
Height = 2835
Left = 240
Picture = "frmxh.frx":01D6
Stretch = -1 'True
Top = 330
Width = 1755
End
Begin VB.Line Line1
BorderColor = &H00808080&
X1 = 0
X2 = 6000
Y1 = 3480
Y2 = 3480
End
Begin VB.Line Line2
BorderColor = &H00FFFFFF&
BorderWidth = 2
X1 = 0
X2 = 6000
Y1 = 3488
Y2 = 3488
End
End
Attribute VB_Name = "frmxh"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Command1.Visible = False
Command2.Caption = "下一步"
Frame1.Caption = "请选择数据年度"
Combo1.Visible = True: Label1.Visible = True
Option1.Visible = False
Option2.Visible = False
End Sub
Private Sub Command2_Click()
Dim QR1, QR2, QR3 As String
QR1 = Format(DateSerial(Combo1.Text, 1, 1), "yyyy-m-d")
'MsgBox QR1
QR2 = Format(DateSerial(Year(Now), Month(Now), Day(Now)), "yyyy-m-d")
'MsgBox QR2
QR3 = Format(DateSerial(Combo1.Text, 12, 31), "yyyy-m-d")
'MsgBox QR3
With ycdck
If Command2.Caption = "下一步" Then
Combo1.Visible = False: Label1.Visible = False
Command1.Visible = True
Frame1.Caption = "请选择销毁项目"
Option1.Visible = True
Option2.Visible = True
Option1.Caption = "销毁出票日期在" & Combo1.Text & "年度且现已到期数据"
Option2.Caption = "销毁出票日期在" & Combo1.Text & "年度的全部数据"
Command2.Caption = "确定"
ElseIf Command2.Caption = "确定" Then
If Option1.Value = True Then
X = MsgBox("警告!是否到期将以您电脑的系统日期为准,现在系统日期为" & QR2 & ",确定此值是否正确,如不正确请单击“取消”,并重新设置系统日期。", vbOKCancel Or vbInformation, "系统信息")
If X = vbCancel Then
Exit Sub
End If
X = MsgBox("确实要" & Option1.Caption & "吗?", vbOKCancel Or vbQuestion, "系统信息")
If X = vbOK Then
Screen.MousePointer = 11
.Adodc1.RecordSource = "select * from 台帐数据 where 到期日期 between#" & QR1 & "#and#" & QR2 & "#" & " and 出票日期 between#" & QR1 & "#and#" & QR3 & "#"
.Adodc1.Refresh
Dim shu As Integer
shu = .Adodc1.Recordset.RecordCount
.Adodc1.Recordset.Close
.Adodc1.Recordset.Open "delete * from 台帐数据 where 到期日期 between#" & QR1 & "#and#" & QR2 & "#" & " and 出票日期 between#" & QR1 & "#and#" & QR3 & "#"
Screen.MousePointer = 0
If shu = 0 Then
MsgBox "没有符合条件的记录。", vbOKOnly Or vbInformation, "系统信息"
Else
MsgBox "已成功删除符合条件的" & shu & "条记录。", vbOKOnly Or vbInformation, "系统信息"
End If
ElseIf X = vbCancel Then
Exit Sub
End If
ElseIf Option2.Value = True Then
X = MsgBox("确实要" & Option2.Caption & "吗?", vbOKCancel Or vbQuestion, "系统信息")
If X = vbOK Then
Screen.MousePointer = 11
.Adodc1.RecordSource = "select * from 台帐数据 where 出票日期 between#" & QR1 & "#and#" & QR3 & "#"
.Adodc1.Refresh
shu = .Adodc1.Recordset.RecordCount
.Adodc1.Recordset.Close
.Adodc1.Recordset.Open "delete * from 台帐数据 where 出票日期 between#" & QR1 & "#and#" & QR3 & "#"
.Adodc1.Refresh
Screen.MousePointer = 0
If shu = 0 Then
MsgBox "没有符合条件的记录。", vbOKOnly Or vbInformation, "系统信息"
Else
MsgBox "已成功删除符合条件的" & shu & "条记录。", vbOKOnly Or vbInformation, "系统信息"
End If
ElseIf X = vbCancel Then
Exit Sub
End If
End If
End If
End With
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Activate()
Combo1.Text = Year(Now) - 3
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -