📄 frmsdz.frm
字号:
lfrpt.Fields(10) = Trim(Text9.Text)
lfrpt.Fields(11) = Trim(Text10.Text)
lfrpt.Update
MsgBox "保存成功!", vbOKOnly + vbExclamation, "信息提示"
baocun = True
Exit Sub
End If
Case Is = "配方9"
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text = "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text = "" Or Text10.Text = "" Then
MsgBox "设定值不能为空,请输入正确设定值 !", vbOKOnly + vbCritical, "错误"
Text1.SetFocus
Exit Sub
Else
Set lfrpt = dbrpt.OpenRecordset("lf9", dbOpenDynaset)
If lfrpt.RecordCount <> 0 Then
lfrpt.Delete
End If
lfrpt.AddNew
lfrpt.Fields(0) = Format(Now(), "yyyy-m-d")
lfrpt.Fields(1) = Format(Time(), "hh:mm")
lfrpt.Fields(2) = Trim(Text1.Text)
lfrpt.Fields(3) = Trim(Text2.Text)
lfrpt.Fields(4) = Trim(Text3.Text)
lfrpt.Fields(5) = Trim(Text4.Text)
lfrpt.Fields(6) = Trim(Text5.Text)
lfrpt.Fields(7) = Trim(Text6.Text)
lfrpt.Fields(8) = Trim(Text7.Text)
lfrpt.Fields(9) = Trim(Text8.Text)
lfrpt.Fields(10) = Trim(Text9.Text)
lfrpt.Fields(11) = Trim(Text10.Text)
lfrpt.Update
MsgBox "保存成功!", vbOKOnly + vbExclamation, "信息提示"
baocun = True
Exit Sub
End If
Case Is = "配方10"
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text = "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text = "" Or Text10.Text = "" Then
MsgBox "设定值不能为空,请输入正确设定值 !", vbOKOnly + vbCritical, "错误"
Text1.SetFocus
Exit Sub
Else
Set lfrpt = dbrpt.OpenRecordset("lf10", dbOpenDynaset)
If lfrpt.RecordCount <> 0 Then
lfrpt.Delete
End If
lfrpt.AddNew
lfrpt.Fields(0) = Format(Now(), "yyyy-m-d")
lfrpt.Fields(1) = Format(Time(), "hh:mm")
lfrpt.Fields(2) = Trim(Text1.Text)
lfrpt.Fields(3) = Trim(Text2.Text)
lfrpt.Fields(4) = Trim(Text3.Text)
lfrpt.Fields(5) = Trim(Text4.Text)
lfrpt.Fields(6) = Trim(Text5.Text)
lfrpt.Fields(7) = Trim(Text6.Text)
lfrpt.Fields(8) = Trim(Text7.Text)
lfrpt.Fields(9) = Trim(Text8.Text)
lfrpt.Fields(10) = Trim(Text9.Text)
lfrpt.Fields(11) = Trim(Text10.Text)
lfrpt.Update
MsgBox "保存成功!", vbOKOnly + vbExclamation, "信息提示"
baocun = True
Exit Sub
End If
End Select
End If
End Sub
Private Sub Combo1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
If Option0.Value Then
Select Case Combo1.Text
Case Is = "配方1"
'Set lfrpt = dbrpt.OpenRecordset("lf1", dbOpenDynaset)
Set lfrpt = dbrpt.OpenRecordset("lf1", dbOpenDynaset)
On Error GoTo errhandle
Text1.Text = lfrpt.Fields(2)
Text2.Text = lfrpt.Fields(3)
Text3.Text = lfrpt.Fields(4)
Text4.Text = lfrpt.Fields(5)
Text5.Text = lfrpt.Fields(6)
Text6.Text = lfrpt.Fields(7)
Text7.Text = lfrpt.Fields(8)
Text8.Text = lfrpt.Fields(9)
Text9.Text = lfrpt.Fields(10)
Text10.Text = lfrpt.Fields(11)
lfrpt.Close
Set lfrpt = Nothing
cmdok.SetFocus
Exit Sub
Case Is = "配方2"
Set lfrpt = dbrpt.OpenRecordset("lf2", dbOpenDynaset)
On Error GoTo errhandle
Text1.Text = lfrpt.Fields(2)
Text2.Text = lfrpt.Fields(3)
Text3.Text = lfrpt.Fields(4)
Text4.Text = lfrpt.Fields(5)
Text5.Text = lfrpt.Fields(6)
Text6.Text = lfrpt.Fields(7)
Text7.Text = lfrpt.Fields(8)
Text8.Text = lfrpt.Fields(9)
Text9.Text = lfrpt.Fields(10)
Text10.Text = lfrpt.Fields(11)
lfrpt.Close
Set lfrpt = Nothing
cmdok.SetFocus
Exit Sub
Case Is = "配方3"
Set lfrpt = dbrpt.OpenRecordset("lf3", dbOpenDynaset)
On Error GoTo errhandle
Text1.Text = lfrpt.Fields(2)
Text2.Text = lfrpt.Fields(3)
Text3.Text = lfrpt.Fields(4)
Text4.Text = lfrpt.Fields(5)
Text5.Text = lfrpt.Fields(6)
Text6.Text = lfrpt.Fields(7)
Text7.Text = lfrpt.Fields(8)
Text8.Text = lfrpt.Fields(9)
Text9.Text = lfrpt.Fields(10)
Text10.Text = lfrpt.Fields(11)
lfrpt.Close
Set lfrpt = Nothing
cmdok.SetFocus
Exit Sub
Case Is = "配方4"
Set lfrpt = dbrpt.OpenRecordset("lf4", dbOpenDynaset)
On Error GoTo errhandle
Text1.Text = lfrpt.Fields(2)
Text2.Text = lfrpt.Fields(3)
Text3.Text = lfrpt.Fields(4)
Text4.Text = lfrpt.Fields(5)
Text5.Text = lfrpt.Fields(6)
Text6.Text = lfrpt.Fields(7)
Text7.Text = lfrpt.Fields(8)
Text8.Text = lfrpt.Fields(9)
Text9.Text = lfrpt.Fields(10)
Text10.Text = lfrpt.Fields(11)
lfrpt.Close
Set lfrpt = Nothing
cmdok.SetFocus
Exit Sub
Case Is = "配方5"
Set lfrpt = dbrpt.OpenRecordset("lf5", dbOpenDynaset)
On Error GoTo errhandle
Text1.Text = lfrpt.Fields(2)
Text2.Text = lfrpt.Fields(3)
Text3.Text = lfrpt.Fields(4)
Text4.Text = lfrpt.Fields(5)
Text5.Text = lfrpt.Fields(6)
Text6.Text = lfrpt.Fields(7)
Text7.Text = lfrpt.Fields(8)
Text8.Text = lfrpt.Fields(9)
Text9.Text = lfrpt.Fields(10)
Text10.Text = lfrpt.Fields(11)
lfrpt.Close
Set lfrpt = Nothing
cmdok.SetFocus
Exit Sub
Case Is = "配方6"
Set lfrpt = dbrpt.OpenRecordset("lf6", dbOpenDynaset)
On Error GoTo errhandle
Text1.Text = lfrpt.Fields(2)
Text2.Text = lfrpt.Fields(3)
Text3.Text = lfrpt.Fields(4)
Text4.Text = lfrpt.Fields(5)
Text5.Text = lfrpt.Fields(6)
Text6.Text = lfrpt.Fields(7)
Text7.Text = lfrpt.Fields(8)
Text8.Text = lfrpt.Fields(9)
Text9.Text = lfrpt.Fields(10)
Text10.Text = lfrpt.Fields(11)
lfrpt.Close
Set lfrpt = Nothing
cmdok.SetFocus
Exit Sub
Case Is = "配方7"
Set lfrpt = dbrpt.OpenRecordset("lf7", dbOpenDynaset)
On Error GoTo errhandle
Text1.Text = lfrpt.Fields(2)
Text2.Text = lfrpt.Fields(3)
Text3.Text = lfrpt.Fields(4)
Text4.Text = lfrpt.Fields(5)
Text5.Text = lfrpt.Fields(6)
Text6.Text = lfrpt.Fields(7)
Text7.Text = lfrpt.Fields(8)
Text8.Text = lfrpt.Fields(9)
Text9.Text = lfrpt.Fields(10)
Text10.Text = lfrpt.Fields(11)
lfrpt.Close
Set lfrpt = Nothing
cmdok.SetFocus
Exit Sub
Case Is = "配方8"
Set lfrpt = dbrpt.OpenRecordset("lf8", dbOpenDynaset)
On Error GoTo errhandle
Text1.Text = lfrpt.Fields(2)
Text2.Text = lfrpt.Fields(3)
Text3.Text = lfrpt.Fields(4)
Text4.Text = lfrpt.Fields(5)
Text5.Text = lfrpt.Fields(6)
Text6.Text = lfrpt.Fields(7)
Text7.Text = lfrpt.Fields(8)
Text8.Text = lfrpt.Fields(9)
Text9.Text = lfrpt.Fields(10)
Text10.Text = lfrpt.Fields(11)
lfrpt.Close
Set lfrpt = Nothing
cmdok.SetFocus
Exit Sub
Case Is = "配方9"
Set lfrpt = dbrpt.OpenRecordset("lf9", dbOpenDynaset)
On Error GoTo errhandle
Text1.Text = lfrpt.Fields(2)
Text2.Text = lfrpt.Fields(3)
Text3.Text = lfrpt.Fields(4)
Text4.Text = lfrpt.Fields(5)
Text5.Text = lfrpt.Fields(6)
Text6.Text = lfrpt.Fields(7)
Text7.Text = lfrpt.Fields(8)
Text8.Text = lfrpt.Fields(9)
Text9.Text = lfrpt.Fields(10)
Text10.Text = lfrpt.Fields(11)
lfrpt.Close
Set lfrpt = Nothing
cmdok.SetFocus
Exit Sub
Case Is = "配方10"
Set lfrpt = dbrpt.OpenRecordset("lf10", dbOpenDynaset)
On Error GoTo errhandle
Text1.Text = lfrpt.Fields(2)
Text2.Text = lfrpt.Fields(3)
Text3.Text = lfrpt.Fields(4)
Text4.Text = lfrpt.Fields(5)
Text5.Text = lfrpt.Fields(6)
Text6.Text = lfrpt.Fields(7)
Text7.Text = lfrpt.Fields(8)
Text8.Text = lfrpt.Fields(9)
Text9.Text = lfrpt.Fields(10)
Text10.Text = lfrpt.Fields(11)
lfrpt.Close
Set lfrpt = Nothing
cmdok.SetFocus
Exit Sub
errhandle:
MsgBox "该配方没有设置数据,请将该配方设置好数据后再选用此配方!", vbCritical + vbExclamation, "警告"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text1.SetFocus
Exit Sub
End Select
End If
If Option1.Value Then
Select Case Combo1.Text
Case Is = "配方1"
Set lfrpt = dbrpt.OpenRecordset("lf1", dbOpenDynaset)
If lfrpt.RecordCount > 0 Then
Text1.Locked = False
Text2.Locked = False
Text3.Locked = False
Text4.Locked = False
Text5.Locked = False
Text6.Locked = False
Text7.Locked = False
Text8.Locked = False
Text9.Locked = False
Text10.Locked = False
Text1.Text = lfrpt.Fields(2)
Text2.Text = lfrpt.Fields(3)
Text3.Text = lfrpt.Fields(4)
Text4.Text = lfrpt.Fields(5)
Text5.Text = lfrpt.Fields(6)
Text6.Text = lfrpt.Fields(7)
Text7.Text = lfrpt.Fields(8)
Text8.Text = lfrpt.Fields(9)
Text9.Text = lfrpt.Fields(10)
Text10.Text = lfrpt.Fields(11)
lfrpt.Close
Set lfrpt = Nothing
MsgBox "该配方数据已存在,请选择其它配方!", vbExclamation + vbOKOnly, "信息提示"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Combo1.SetFocus
Text1.Locked = True
Text2.Locked = True
Text3.Locked = True
Text4.Locked = True
Text5.Locked = True
Text6.Locked = True
Text7.Locked = True
Text8.Locked = True
Text9.Locked = True
Text10.Locked = True
Exit Sub
Else
Text1.Locked = False
Text2.Locked = False
Text3.Locked = False
Text4.Locked = False
Text5.Locked = False
Text6.Locked = False
Text7.Locked = False
Text8.Locked = False
Text9.Locked = False
Text10.Locked = False
Text1.SetFocus
Exit Sub
End If
Case Is = "配方2"
Set lfrpt = dbrpt.OpenRecordset("lf2", dbOpenDynaset)
If lfrpt.RecordCount > 0 Then
Text1.Locked = False
Text2.Locked = False
Text3.Locked = False
Text4.Locked = False
Text5.Locked = False
Text6.Locked = False
Text7.Locked = False
Text8.Locked = False
Text9.Locked = False
Text10.Locked = False
Text1.Text = lfrpt.Fields(2)
Text2.Text = lfrpt.Fields(3)
Text3.Text = lfrpt.Fields(4)
Text4.Text = lfrpt.Fields(5)
Text5.Text = lfrpt.Fields(6)
Text6.Text = lfrpt.Fields(7)
Text7.Text = lfrpt.Fields(8)
Text8.Text = lfrpt.Fields(9)
Text9.Text = lfrpt.Fields(10)
Text10.Text = lfrpt.Fields(11)
lfrpt.Close
Set lfrpt = Nothing
MsgBox "该配方数据已存在,请选择其它配方!", vbExclamation + vbOKOnly, "信息提示"
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Combo1.SetFocus
Text1.Locked = True
Text2.Locked = True
Text3.Locked = True
Text4.Locked = True
Text5.Locked = True
Text6.Locked = True
Text7.Locked = True
Text8.Locked = True
Text9.Locked = True
Text10.Locked = True
Exit Sub
Else
Text1.Locked = False
Text2.Locked = False
Text3.Locked = False
Text4.Locked = False
Text5.Locked = False
Text6.Locked = False
Text7.Locked = False
Text8.Locked = False
Text9.Locked = False
Text10.Locked = False
Text1.SetFocus
Exit Sub
End If
Case Is = "配方3"
Set lfrpt = dbrpt.OpenRecordset("lf3", dbOpenDynaset)
If lfrpt.RecordCount > 0 Then
Text1.Locked = False
Text2.Locked = False
Text3.Locked = False
Text4.Locked = False
Text5.Locked = False
Text6.Locked = False
Text7.Locked = False
Text8.Locked = False
Text9.Locked = False
Text10.Locked = False
Text1.Text = lfrpt.Fields(2)
Text2.Text = lfrpt.Fields(3)
Text3.Text = lfrpt.Fields(4)
Text4.Text = lfrpt.Fields(5)
Text5.Text = lfrpt.Fields(6)
Text6.Text = lfrpt.Fields(7)
Text7.Text = lfrpt.Fields(8)
Text8.Text = lfrpt.Fields(9)
Text9.Text = lfrpt.Fields(10)
Text10.Text = lfrpt.Fields(11)
lfrpt.Close
Set lfrpt =
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -