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

📄 form4.frm

📁 这是我自己编写的关于创建和修改自己定义的数据库
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      Height          =   255
      Left            =   240
      TabIndex        =   22
      Top             =   3480
      Width           =   855
   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          =   495
      Left            =   120
      TabIndex        =   11
      Top             =   2640
      Width           =   975
   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        =   9
      Top             =   2160
      Width           =   495
   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        =   8
      Top             =   1560
      Width           =   495
   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          =   375
      Left            =   2760
      TabIndex        =   7
      Top             =   1560
      Width           =   1215
   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          =   375
      Left            =   5280
      TabIndex        =   6
      Top             =   1560
      Width           =   1215
   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            =   7800
      TabIndex        =   5
      Top             =   1560
      Width           =   855
   End
   Begin VB.Label Label1 
      Caption         =   "WFK-03-JXB2.PCB解调器板测试记录表"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2520
      TabIndex        =   0
      Top             =   480
      Width           =   5415
   End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim t, u, v, w, X, Y, z As Integer
Dim str As String



Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""

Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.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("jietiaoqiban")
'rec.AddNew
'rec!批次 = Text1
'rec!测试温度 = Text2
'rec!相对湿度 = Text3
'rec!电源电压 = Text4
'rec!序号 = Text5
'rec!电台电源控功能 = Text6
'rec!VX110 = Text7
'rec!TP2幅度MV = Text8
'rec!V5状态 = Text9
'rec!VX17 = Text10
'rec!话音功能 = Text11
'rec!备注 = Text12

'rec!测试人 = Text13
'rec!测试日期 = Text14
'rec!检验人 = Text15
'rec!检验日期 = Text16

'rec.Update
'ext1.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 = ""
If Text5.Text = "" Then
    X = 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 jietiaoqiban where 序号 ='" & Text5.Text & " ' ")
    If rec.RecordCount > 0 Then
        Y = MsgBox("确定要删除该记录", 4, "提示")
        If Y = 6 Then
            'Dim db1 As Database
            'Dim rec1 As Recordset
            'Set db1 = OpenDatabase(App.Path + "\wfk-03.mdb")
            'Set rec1 = db1.OpenRecordset("diantai")
            'db1.Execute ("delete * from jietiaoqiban where 序号 ='" & Text5.Text & " ' ")
            db.Execute ("delete * from jietiaoqiban 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 = ""
          
        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 = ""
        z = MsgBox("编号不存在,请输入要删除的编号", 0, "提示")
    End If
    rec.Close
    Set rec = Nothing

End If



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  jietiaoqiban  where 序号 = '" & Text5.Text & " ' ")
If Text5.Text = "" Then
    t = 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("电台电源控功能"))
        Text7.Text = gfNullToString(rec.Fields("VX110"))
        Text8.Text = gfNullToString(rec.Fields("TP2幅度MV"))
        Text9.Text = gfNullToString(rec.Fields("V5状态"))
        Text10.Text = gfNullToString(rec.Fields("VX17"))
        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("检验日期"))
    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 = ""
      u = 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  jietiaoqiban where 序号 = '" & Text5.Text & " ' ")
If Text5.Text = "" Then
    v = MsgBox("请输入序号", 0, "提示")
Else
    If rec.RecordCount = 0 Then
        str = "insert into jietiaoqiban ("
        str = str & "批次,测试温度,相对湿度,电源电压,序号,电台电源控功能,VX110,TP2幅度MV,V5状态,VX17,话音功能,"
        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 & ") "
        db.Execute (str)
    Else
        w = MsgBox("是否覆盖以前的记录", 4, "提示")
        If w = 6 Then

            Set rec = db.OpenRecordset("select * from  jietiaoqiban  where 序号= '" & Text5.Text & " ' ")
            
            db.Execute "update jietiaoqiban set 批次 = '" & Text1.Text & " ' where 序号 = '" & rec!序号 & "'"
            db.Execute "update jietiaoqiban set 测试温度 = '" & Text2.Text & " ' where 序号 = '" & rec!序号 & "'"
            db.Execute "update jietiaoqiban set 相对湿度 = '" & Text3.Text & " ' where 序号 = '" & rec!序号 & "'"
            db.Execute "update jietiaoqiban set 电源电压 = '" & Text4.Text & " ' where 序号 = '" & rec!序号 & "'"
            
            db.Execute "update jietiaoqiban set 电台电源控功能 = '" & Text6.Text & " ' where 序号 = '" & rec!序号 & "'"
            db.Execute "update jietiaoqiban set VX110 = '" & Text7.Text & " ' where 序号 = '" & rec!序号 & "'"
            db.Execute "update jietiaoqiban set TP2幅度MV = '" & Text8.Text & " ' where 序号 = '" & rec!序号 & "'"
            db.Execute "update jietiaoqiban set V5状态 = '" & Text9.Text & " ' where 序号 = '" & rec!序号 & "'"
            db.Execute "update jietiaoqiban set VX17 = '" & Text10.Text & " ' where 序号 = '" & rec!序号 & "'"
            db.Execute "update jietiaoqiban set 话音功能 = '" & Text11.Text & " ' where 序号 = '" & rec!序号 & "'"
            db.Execute "update jietiaoqiban set 备注 = '" & Text12.Text & " ' where 序号 = '" & rec!序号 & "'"
            
            db.Execute "update jietiaoqiban set 测试人 = '" & Text13.Text & " ' where 序号 = '" & rec!序号 & "'"
            db.Execute "update jietiaoqiban set 测试日期 = '" & Text14.Text & " ' where 序号 = '" & rec!序号 & "'"
            db.Execute "update jietiaoqiban set 检验人 = '" & Text15.Text & " ' where 序号 = '" & rec!序号 & "'"
            db.Execute "update jietiaoqiban set 检验日期 = '" & Text16.Text & " ' where 序号 = '" & rec!序号 & "'"
        Else
        End If
    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 = ""

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 = ""
End Sub

Private Sub Command6_Click()
Unload Me
Form1.Show
'Form1.Show
'Form4.Visible = False
'Text1.Text = ""
 'ext2.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 = ""
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 + -