📄 form3.frm
字号:
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
End Sub
Private Sub Command2_Click()
'Dim db As Database
'Dim rec As Recordset
'Set db = OpenDatabase(App.Path + "\wfk-03.mdb")
'Set rec = db.OpenRecordset("zhukongban")
'rec.AddNew
'rec!批次 = Text1
'rec!测试温度 = Text2
'rec!相对湿度 = Text3
'rec!电源电压 = Text4
'rec.fields("序号") = Text5
'rec!V700状态 = Text6
'rec!VTP601 = Text7
'rec!VTP602 = Text8
'rec!VTP100 = Text9
'rec!脉冲采集各指示灯状态 = Text10
'rec!遥信输入各指示灯状态 = Text11
'rec!遥控输出各测试点电压 = Text12
'rec!其他功能 = Text13
'rec!备注 = Text14
'rec!测试人 = Text15
'rec!测试日期 = Text16
'rec!检验人 = Text17
'rec!检验日期 = Text18
'rec.Update
'Text1.Text = ""
'Text2.Text = ""
'Text3.Text = ""
'Text4.Text = ""
'Text5.Text = ""
'Text6.Text = ""
'Text7.Text = ""
'Text8.Text = ""
'Text9.Text = ""
'Text10.Text = ""
'Text11.Text = ""
'Text12.Text = ""
'Text13.Text = ""
'Text14.Text = ""
'Text15.Text = ""
'Text16.Text = ""
'Text17.Text = ""
'Text18.Text = ""
If Text5.Text = "" Then
q = MsgBox("请输入删除序号", 0, "提示")
Else
Dim db As Database
Dim rec As Recordset
Set db = OpenDatabase(App.Path + "\wfk-03.mdb")
Set rec = db.OpenRecordset("select * from zhukongban where 序号 ='" & Text5.Text & " ' ")
If rec.RecordCount > 0 Then
r = MsgBox("确定要删除该记录", 4, "提示")
If r = 6 Then
'Dim db1 As Database
'Dim rec1 As Recordset
'Set db1 = OpenDatabase(App.Path + "\wfk-03.mdb")
'Set rec1 = db1.OpenRecordset("diantai")
db.Execute ("delete * from zhukongban where 序号 ='" & Text5.Text & " ' ")
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Else
End If
Else
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
'Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
s = MsgBox("序号不存在,请输入要删除的序号", 0, "提示")
End If
rec.Close
Set rec = Nothing
End If
'rec.Close
'Set rec = Nothing
End Sub
Private Sub Command3_Click()
Dim db As Database
Dim rec As Recordset
Set db = OpenDatabase(App.Path + "\wfk-03.mdb")
Set rec = db.OpenRecordset("select * from zhukongban where 序号 = '" & Text5.Text & " ' ")
If Text5.Text = "" Then
m = MsgBox("请输入查询序号", 0, "提示")
Else
If rec.RecordCount > 0 Then
Text1.Text = gfNullToString(rec.Fields("批次"))
Text2.Text = gfNullToString(rec.Fields("测试温度"))
Text3.Text = gfNullToString(rec.Fields("相对湿度"))
Text4.Text = gfNullToString(rec.Fields("电源电压"))
Text5.Text = gfNullToString(rec.Fields("序号"))
Text6.Text = gfNullToString(rec.Fields("V700状态"))
Text7.Text = gfNullToString(rec.Fields("VTP601"))
Text8.Text = gfNullToString(rec.Fields("VTP602"))
Text9.Text = gfNullToString(rec.Fields("VTP100"))
Text10.Text = gfNullToString(rec.Fields("脉冲采集各指示灯状态"))
Text11.Text = gfNullToString(rec.Fields("遥信输入各指示灯状态"))
Text12.Text = gfNullToString(rec.Fields("遥控输出各测试点电压"))
Text13.Text = gfNullToString(rec.Fields("其他功能"))
Text14.Text = gfNullToString(rec.Fields("备注"))
Text15.Text = gfNullToString(rec.Fields("测试人"))
Text16.Text = gfNullToString(rec.Fields("测试日期"))
Text17.Text = gfNullToString(rec.Fields("检验人"))
Text18.Text = gfNullToString(rec.Fields("检验日期"))
Else
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
'Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
n = MsgBox("序号不存在,请重新输入", 0, "提示")
End If
End If
rec.Close
Set rec = Nothing
End Sub
Private Sub Command4_Click()
Dim db As Database
Dim rec As Recordset
'Dim str As String
Set db = OpenDatabase(App.Path + "\wfk-03.mdb")
Set rec = db.OpenRecordset("select 序号 from zhukongban where 序号 = '" & Text5.Text & " ' ")
If Text5.Text = "" Then
o = MsgBox("请输入序号", 0, "提示")
Else
If rec.RecordCount = 0 Then
str = "insert into zhukongban ("
str = str & "批次,测试温度,相对湿度,电源电压,序号,V700状态,VTP601,VTP602,VTP100,脉冲采集各指示灯状态,遥信输入各指示灯状态,"
str = str & "遥控输出各测试点电压,其他功能,备注,测试人,测试日期,检验人,检验日期"
str = str & ")"
str = str & " values("
str = str & "'" & Text1.Text & "',"
str = str & "'" & Text2.Text & "',"
str = str & "'" & Text3.Text & "',"
str = str & "'" & Text4.Text & "',"
str = str & "'" & Text5.Text & "',"
str = str & "'" & Text6.Text & "',"
str = str & "'" & Text7.Text & "',"
str = str & "'" & Text8.Text & "',"
str = str & "'" & Text9.Text & "',"
str = str & "'" & Text10.Text & "',"
str = str & "'" & Text11.Text & "',"
str = str & "'" & Text12.Text & "',"
str = str & "'" & Text13.Text & "',"
str = str & "'" & Text14.Text & "',"
str = str & "'" & Text15.Text & "',"
str = str & "'" & Text16.Text & "',"
str = str & "'" & Text17.Text & "',"
str = str & "'" & Text18.Text & "'"
str = str & ") "
db.Execute (str)
Else
p = MsgBox("是否覆盖以前的记录", 4, "提示")
If p = 6 Then
Set rec = db.OpenRecordset("select * from zhukongban where 序号= '" & Text5.Text & " ' ")
db.Execute "update zhukongban set 批次 = '" & Text1.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set 测试温度 = '" & Text2.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set 相对湿度 = '" & Text3.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set 电源电压 = '" & Text4.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set V700状态 = '" & Text6.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set VTP601 = '" & Text7.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set VTP602 = '" & Text8.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set VTP100 = '" & Text9.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set 脉冲采集各指示灯状态 = '" & Text10.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set 遥信输入各指示灯状态 = '" & Text11.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set 遥控输出各测试点电压 = '" & Text12.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set 其他功能 = '" & Text13.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set 备注 = '" & Text14.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set 测试人 = '" & Text15.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set 测试日期 = '" & Text16.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set 检验人 = '" & Text17.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
db.Execute "update zhukongban set 检验日期 = '" & Text18.Text & " ' where 序号 = '" & rec.Fields("序号") & "'"
Else
End If
End If
End If
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
'Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
rec.Close
Set rec = Nothing
End Sub
Private Sub Command5_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
'Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
End Sub
Private Sub Command6_Click()
Unload Me
Form1.Show
'Form1.Show
'Form3.Visible = False
'Text1.Text = ""
'Text2.Text = ""
'Text3.Text = ""
'Text4.Text = ""
'Text5.Text = ""
'Text6.Text = ""
'Text7.Text = ""
'Text8.Text = ""
'Text9.Text = ""
'Text10.Text = ""
'Text11.Text = ""
'Text12.Text = ""
'ext13.Text = ""
'ext14.Text = ""
'Text15.Text = ""
'Text16.Text = ""
'Text17.Text = ""
'Text18.Text = ""
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
Form1.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -