📄 frmpararecord.frm
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmParaRecord
Caption = "寻优微机参数修改记录"
ClientHeight = 7170
ClientLeft = 60
ClientTop = 345
ClientWidth = 10635
Icon = "frmParaRecord.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 7170
ScaleWidth = 10635
StartUpPosition = 2 '屏幕中心
Begin MSComCtl2.UpDown UpDownID
Height = 380
Left = 5400
TabIndex = 6
Top = 6780
Width = 240
_ExtentX = 423
_ExtentY = 661
_Version = 393216
Value = 1
Max = 50
Enabled = -1 'True
End
Begin VB.TextBox txtID
Alignment = 2 'Center
Height = 270
Left = 4800
TabIndex = 5
Text = "1"
Top = 6840
Width = 615
End
Begin VB.CommandButton cmdDelete
Caption = "删除上月纪录"
Height = 375
Left = 7440
TabIndex = 4
Top = 6750
Width = 1365
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 330
Left = 1560
TabIndex = 2
Top = 6795
Width = 1485
_ExtentX = 2619
_ExtentY = 582
_Version = 393216
CustomFormat = "2004-12"
Format = 60817409
CurrentDate = 38166
End
Begin VB.CommandButton cmdClose
Caption = "关闭&C"
Height = 375
Left = 8955
TabIndex = 1
Top = 6750
Width = 1365
End
Begin MSComctlLib.ListView lstvPara
Height = 6675
Left = 0
TabIndex = 0
Top = 0
Width = 10560
_ExtentX = 18627
_ExtentY = 11774
SortKey = 1
View = 3
LabelEdit = 1
SortOrder = -1 'True
LabelWrap = 0 'False
HideSelection = -1 'True
AllowReorder = -1 'True
FullRowSelect = -1 'True
GridLines = -1 'True
_Version = 393217
ForeColor = -2147483640
BackColor = -2147483643
BorderStyle = 1
Appearance = 1
NumItems = 12
BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Text = "炉号"
Object.Width = 1058
EndProperty
BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 1
Text = "日期"
Object.Width = 1942
EndProperty
BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628}
SubItemIndex = 2
Text = "时间"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 3
Text = "吹风"
Object.Width = 1058
EndProperty
BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 4
Text = "上吹"
Object.Width = 1058
EndProperty
BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 5
Text = "上行温度"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(7) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 6
Text = "下行温度"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(8) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 7
Text = "吹风排队"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(9) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 8
Text = "上加氮"
Object.Width = 1587
EndProperty
BeginProperty ColumnHeader(10) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 9
Text = "给料"
Object.Width = 1587
EndProperty
BeginProperty ColumnHeader(11) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 10
Text = "循环时间"
Object.Width = 1764
EndProperty
BeginProperty ColumnHeader(12) {BDD1F052-858B-11D1-B16A-00C0F0283628}
Alignment = 2
SubItemIndex = 11
Text = "值班工号"
Object.Width = 1764
EndProperty
End
Begin VB.Label Label1
Caption = "选择浏览的炉号:"
Height = 240
Index = 1
Left = 3360
TabIndex = 7
Top = 6840
Width = 1500
End
Begin VB.Label Label1
Caption = "选择浏览的月份:"
Height = 240
Index = 0
Left = 0
TabIndex = 3
Top = 6840
Width = 1500
End
End
Attribute VB_Name = "frmParaRecord"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs As New ADODB.Recordset
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdDelete_Click()
On Error Resume Next
Dim lngmonth As Long
lngPopedom = 4
frmPassword.Show 1
If mPassword Then
If Month(DTPicker1) - 1 = 0 Then
lngmonth = 12
Else
lngmonth = Month(DTPicker1) - 1
End If
If IsAcess Then
Cmd.CommandText = "Delete from recparaedit where month(CDATE(WDate))='" & lngmonth & "'"
Else
Cmd.CommandText = "Delete from recparaedit where month(WDate)='" & lngmonth & "'"
End If
Conn.Execute Cmd.CommandText
End If
End Sub
Private Sub DTPicker1_Change()
On Error Resume Next
If DTPicker1.Value < Date Then
Call lstRefresh
End If
End Sub
Private Sub UpDownID_Change()
On Error Resume Next
If UpDownID.Value > StoveStart + StoveNumber - 1 Then
UpDownID.Value = StoveStart
ElseIf UpDownID.Value < StoveStart Then
UpDownID.Value = StoveStart + StoveNumber - 1
End If
txtID.Text = UpDownID.Value
Call lstRefresh
End Sub
Private Sub Form_Load()
On Error Resume Next
txtID.Text = StoveStart
UpDownID.Value = StoveStart
UpDownID.Min = StoveStart
UpDownID.Max = StoveStart + StoveNumber - 1
DTPicker1.Value = Date
Call lstRefresh
End Sub
Private Function lstRefresh()
Dim xItem As ListItem
On Error GoTo ErrHandle
lstvPara.ListItems.Clear
If IsAcess Then
Cmd.CommandText = "Select * from RecParaEdit Where WDate=CDATE('" & DTPicker1.Value & "') and ID='" & txtID.Text & "'order by Wtime"
Else
Cmd.CommandText = "Select * from RecParaEdit Where Year(WDate)='" & DTPicker1.Year & "' And Month(WDate)='" & DTPicker1.Month & "' And ID='" & txtID.Text & "' order by WDate desc,WTime desc "
If rs.State = 1 Then
rs.Close
End If
End If
rs.OPEN Cmd, , adOpenDynamic, adLockReadOnly
If rs.RecordCount = 0 Then
frmMain.Statur.Caption = "记录集数据为空!"
rs.Close
Set rs = Nothing
Exit Function
End If
If Not rs.EOF Then rs.MoveFirst
Do While Not rs.EOF
Set xItem = lstvPara.ListItems.Add(, , rs("ID"))
xItem.SubItems(1) = rs("WDate")
xItem.SubItems(2) = rs("WTime")
xItem.SubItems(3) = rs("CF")
xItem.SubItems(4) = rs("SC")
xItem.SubItems(5) = rs("SXWD")
xItem.SubItems(6) = rs("XXWD")
xItem.SubItems(7) = rs("Queue")
xItem.SubItems(8) = rs("SJN")
xItem.SubItems(9) = rs("GL")
xItem.SubItems(10) = rs("CycleTime")
xItem.SubItems(11) = rs("UserID")
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
lstRefresh = 0
Exit Function
ErrHandle:
lstRefresh = 1
If rs.State = 1 Then
rs.Close
End If
Set rs = Nothing
frmMain.Statur.Caption = "记录集数据为空!"
Err.Clear
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -