⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 这是我自己编写的关于创建和修改自己定义的数据库
💻 FRM
📖 第 1 页 / 共 4 页
字号:
            Text28.Text = ""
            Text29.Text = ""
            Text30.Text = ""
End Sub

Private Sub Command3_Click()
'Dim str As String
Dim db As Database
Dim rec As Recordset
'Dim p As Integer
Set db = OpenDatabase(App.Path + "\wfk-03.mdb")
If Text4.Text = "" Then
   c = MsgBox("请输入编号", 0, "提示")
Else
    Set rec = db.OpenRecordset("select 整机编号 from  main  where 整机编号= '" & Text4.Text & " ' ")
    If rec.RecordCount = 0 Then
        str = "insert into main("
        str = str & "检测温度,相对湿度,电源电压,整机编号,检验日期,检验员,电台型号,电台编号,电源型号,电源编号,主板编号,"
        str = str & "解调器板,接线板号,显示板号,LED显示屏,"
        str = str & "A,B,C,D,E,F,G,H,I,J,K,L,M,N"
        str = str & ")"
        str = str & " values("
        'str = str & "'" & Text16.Text & "',"
        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 & "'" & Text17.Text & "',"
        str = str & "'" & Text18.Text & "',"
        str = str & "'" & Text19.Text & "',"
        str = str & "'" & Text20.Text & "',"
        str = str & "'" & Text21.Text & "',"
        str = str & "'" & Text22.Text & "',"
        str = str & "'" & Text23.Text & "',"
        str = str & "'" & Text24.Text & "',"
        str = str & "'" & Text25.Text & "',"
        str = str & "'" & Text26.Text & "',"
        str = str & "'" & Text27.Text & "',"
        str = str & "'" & Text28.Text & "',"
        str = str & "'" & Text29.Text & "',"
        str = str & "'" & Text30.Text & "'"
        str = str & ")"
        db.Execute (str)
    Else
        'Dim r As Integer
        d = MsgBox("是否覆盖以前的记录", 4, "提示")
        If d = 6 Then
        'Dim db As Database
        'Dim rec As Recordset
        'Set db = OpenDatabase(App.Path + "\wfk-03.mdb")
        'Set rec = db.OpenRecordset("main")
        'If Text16.Text = rec.Fields("编号") Then
        'db.Execute "update main set 编号 = '" & Text16.Text & " ' where 编号 = '" & rec.Fields("编号") & "'"
        ' Set rec = db.OpenRecordset("select * from  main  where 编号= '" & Text16.Text & " ' ")
        db.Execute "update main set 检测温度 = '" & Text1.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set 相对湿度 = '" & Text2.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set 电源电压 = '" & Text3.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        'db.Execute "update main set 整机编号 = '" & Text4.Text & " ' where 编号 = '" & rec.Fields("编号") & "'"
        db.Execute "update main set 检验日期 = '" & Text5.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set 检验员 = '" & Text6.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set 电台型号 = '" & Text7.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set 电台编号 = '" & Text8.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set 电源型号 = '" & Text9.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set 电源编号 = '" & Text10.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set 主板编号 = '" & Text11.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set 解调器板 = '" & Text12.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set 接线板号 = '" & Text13.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set 显示板号 = '" & Text14.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set LED显示屏 = '" & Text15.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set A = '" & Text17.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set B = '" & Text18.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set C = '" & Text19.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set D = '" & Text20.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set E = '" & Text21.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set F = '" & Text22.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set G = '" & Text23.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set H = '" & Text24.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set I = '" & Text25.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set J = '" & Text26.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set K = '" & Text27.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set L = '" & Text28.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set M = '" & Text29.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
        db.Execute "update main set N = '" & Text30.Text & " ' where 整机编号 = '" & rec.Fields("整机编号") & "'"
Else
End If
End If
rec.Close
Set rec = Nothing

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 = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text22.Text = ""
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Text26.Text = ""
Text27.Text = ""
Text28.Text = ""
Text29.Text = ""
Text30.Text = ""
End If

End Sub






Private Sub Command4_Click()
End
End Sub

Private Sub Command5_Click()
Form1.Visible = False
form2.Text1.Text = Form1.Text7.Text
form2.Text2.Text = Form1.Text8.Text
form2.Show
'form2.Text1.Enabled = False
'form2.Text2.Enabled = False

End Sub



Private Sub Command6_Click()
If Text4.Text = "" Then
    e = 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 main where 整机编号 ='" & Text4.Text & " ' ")
    If rec.RecordCount > 0 Then
        f = MsgBox("确定要删除该记录", 4, "提示")
        If f = 6 Then
            'Dim db1 As Database
            'Dim rec1 As Recordset
            'Set db1 = OpenDatabase(App.Path + "\wfk-03.mdb")
            'Set rec1 = db1.OpenRecordset("main")
            db.Execute ("delete * from main where 整机编号='" & Text4.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 = ""
            Text19.Text = ""
            Text20.Text = ""
            Text21.Text = ""
            Text22.Text = ""
            Text23.Text = ""
            Text24.Text = ""
            Text25.Text = ""
            Text26.Text = ""
            Text27.Text = ""
            Text28.Text = ""
            Text29.Text = ""
            Text30.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 = ""
            Text19.Text = ""
            Text20.Text = ""
            Text21.Text = ""
            Text22.Text = ""
            Text23.Text = ""
            Text24.Text = ""
            Text25.Text = ""
            Text26.Text = ""
            Text27.Text = ""
            Text28.Text = ""
            Text29.Text = ""
            Text30.Text = ""
        g = MsgBox("编号不存在,请输入要删除的编号", 0, "提示")
    End If
    rec.Close
    Set rec = Nothing
End If

'rec.Close
'Set rec = Nothing
'rec1.Close
'Set rec1 = Nothing
End Sub

'Private Sub Command6_Click()
'Dim db As Database
'Dim rec As Recordset
'Set db = OpenDatabase(App.Path + "\wfk-03.mdb")
'Set rec = db.OpenRecordset("main")
'rec.AddNew
'rec.Fields("编号") = Text16
'rec!检测温度 = Text1
'rec!相对湿度 = Text2
'rec!电源电压 = Text3
'rec!整机编号 = Text4
'rec!检验日期 = Text5
'rec!检验员 = Text6
'rec!电台型号 = Text7
'rec!电台编号 = Text8
'rec!电源型号 = List1
'rec!电源编号 = Text10
'rec!主板编号 = Text11
'rec!解调器板 = Text12
'rec!接线板号 = Text13
'rec!显示板号 = Text14
'rec!LED显示屏 = Text15
'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 = ""
'Command1.Enabled = True
'Command3.Enabled = True


'End Sub

Private Sub Command7_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 = ""
Text19.Text = ""
Text20.Text = ""
Text21.Text = ""
Text22.Text = ""
Text23.Text = ""
Text24.Text = ""
Text25.Text = ""
Text26.Text = ""
Text27.Text = ""
Text28.Text = ""
Text29.Text = ""
Text30.Text = ""

End Sub



Private Sub Command8_Click()
If Trim(Text9.Text) = "P100S-1-5A" Then
  
   Form8.Label6.Visible = True
   Form8.Text5.Visible = True
   
   Form8.Label7.Visible = False
   Form8.Text6.Visible = False
   
   Form8.Label14.Visible = True
   Form8.Text13.Visible = True
   
   Form8.Label15.Visible = False
   Form8.Text14.Visible = False
Else
   Form8.Label6.Visible = False
   Form8.Text5.Visible = False
   
   Form8.Label7.Visible = True
   Form8.Text6.Visible = True
   
   Form8.Label14.Visible = False
   Form8.Text13.Visible = False
   
   Form8.Label15.Visible = True
   Form8.Text14.Visible = True

End If

Form8.Show
Form1.Visible = False

Form8.Text1.Text = Form1.Text9.Text
Form8.Text2.Text = Form1.Text10



End Sub

Private Sub Command9_Click()
Form3.Show
Form1.Visible = False
Form3.Text5.Text = Form1.Text11.Text

End Sub



Private Sub form_load()

 'list1.AddItem "P075-1-5BG"
'List1.AddItem "P100S-1-5A"
List1.Visible = False
Text9.Enabled = False
Combo1.AddItem "P075-1-5BG"
Combo1.AddItem "P100S-1-5A"
End Sub

Private Sub Combo1_click()
Text9.Text = Combo1.Text

End Sub

'Private Sub List1_Click()
'Text9.Text = List1.Text
'End Sub

Private Sub Form_Unload(Cancel As Integer)

Unload Me
'Unload Allform



End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -