📄 form2.frm
字号:
Caption = "灵敏度"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4200
TabIndex = 15
Top = 3360
Width = 735
End
Begin VB.Label Label8
Caption = "MIC输入"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 720
TabIndex = 13
Top = 3360
Width = 735
End
Begin VB.Label Label7
Caption = "功率"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4320
TabIndex = 11
Top = 2760
Width = 495
End
Begin VB.Label Label6
Caption = "发射电流"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 600
TabIndex = 10
Top = 2760
Width = 855
End
Begin VB.Label Label5
Caption = "频偏"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 4320
TabIndex = 8
Top = 2160
Width = 495
End
Begin VB.Label Label4
Caption = "发射频率"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 600
TabIndex = 5
Top = 2160
Width = 855
End
Begin VB.Label Label3
Caption = "电台编号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 3960
TabIndex = 2
Top = 1560
Width = 855
End
Begin VB.Label Label2
Caption = "电台型号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 600
TabIndex = 1
Top = 1560
Width = 975
End
Begin VB.Label Label1
Caption = "电台检测记录"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3720
TabIndex = 0
Top = 480
Width = 1935
End
End
Attribute VB_Name = "form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim h, i, j, k, l As Integer
Dim str As String
Private Sub Command2_Click()
If Text2.Text = "" Then
j = 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 diantai where 电台编号 ='" & Text2.Text & " ' ")
If rec.RecordCount > 0 Then
k = MsgBox("确定要删除该记录", 4, "提示")
If k = 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 diantai where 电台编号='" & Text2.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 = ""
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 = ""
l = 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 diantai where 电台编号= '" & Text2.Text & " ' ")
If Text2.Text = "" Then
i = MsgBox("请输入查询编号", 0, "提示")
Else
If rec.RecordCount > 0 Then
Text1.Text = gfNullToString(rec.Fields("电台型号"))
Text3.Text = gfNullToString(rec.Fields("发射频率"))
Text4.Text = gfNullToString(rec.Fields("频偏"))
Text5.Text = gfNullToString(rec.Fields("发射电流"))
Text6.Text = gfNullToString(rec.Fields("功率"))
Text7.Text = gfNullToString(rec.Fields("MIC输入"))
Text8.Text = gfNullToString(rec.Fields("灵敏度"))
Text9.Text = gfNullToString(rec.Fields("接收幅度"))
Text10.Text = gfNullToString(rec.Fields("静噪灵敏度"))
Text11.Text = gfNullToString(rec.Fields("检验日期"))
Text12.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 = ""
h = MsgBox("编号不存在,请重新输入", 0, "提示")
End If
End If
rec.Close
Set rec = Nothing
End Sub
Private Sub Command6_Click()
Unload Me
Form1.Show
'form2.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 = ""
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 diantai where 电台编号= '" & Text2.Text & " ' ")
If Text2.Text = "" Then
j = MsgBox("请输入编号", 0, "提示")
Else
If rec.RecordCount = 0 Then
str = "insert into diantai("
str = str & "电台型号,电台编号,发射频率,频偏,发射电流,功率,MIC输入,灵敏度,接收幅度,静噪灵敏度,"
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 & ") "
db.Execute (str)
Else
l = MsgBox("是否覆盖以前的记录", 4, "提示")
If l = 6 Then
Set rec = db.OpenRecordset("select * from diantai where 电台编号 = '" & Text2.Text & " ' ")
db.Execute "update diantai set 电台型号 = '" & Text1.Text & " ' where 电台编号 = '" & rec.Fields("电台编号") & "'"
db.Execute "update diantai set 发射频率 = '" & Text3.Text & " ' where 电台编号 = '" & rec.Fields("电台编号") & "'"
db.Execute "update diantai set 频偏 = '" & Text4.Text & " ' where 电台编号 = '" & rec.Fields("电台编号") & "'"
db.Execute "update diantai set 发射电流 = '" & Text5.Text & " ' where 电台编号 = '" & rec.Fields("电台编号") & "'"
db.Execute "update diantai set 功率 = '" & Text6.Text & " ' where 电台编号 = '" & rec.Fields("电台编号") & "'"
db.Execute "update diantai set MIC输入 = '" & Text7.Text & " ' where 电台编号 = '" & rec.Fields("电台编号") & "'"
db.Execute "update diantai set 灵敏度 = '" & Text8.Text & " ' where 电台编号 = '" & rec.Fields("电台编号") & "'"
db.Execute "update diantai set 接收幅度 = '" & Text9.Text & " ' where 电台编号 = '" & rec.Fields("电台编号") & "'"
db.Execute "update diantai set 静噪灵敏度 = '" & Text10.Text & " ' where 电台编号 = '" & rec.Fields("电台编号") & "'"
db.Execute "update diantai set 检验日期 = '" & Text11.Text & " ' where 电台编号 = '" & rec.Fields("电台编号") & "'"
db.Execute "update diantai set 检验人 = '" & Text12.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 = ""
rec.Close
Set rec = Nothing
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("diantai")
'rec.AddNew
'rec!电台型号 = Text1
'rec.fields("电台编号") = Text2
'rec!发射频率 = Text3
'rec!频偏 = Text4
'rec!发射电流 = Text5
'rec!功率 = Text6
'rec!MIC输入 = Text7
'rec!灵敏度 = Text8
'rec!接收幅度 = Text9
'rec!静噪灵敏度 = Text10
'rec!检验日期 = Text11
'rec!检验人 = Text12
'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 = ""
'End Sub
Private Sub Command1_Click()
'Text1.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
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 = ""
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 + -