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

📄 form6.frm

📁 这是我自己编写的关于创建和修改自己定义的数据库
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   5760
      TabIndex        =   9
      Top             =   2160
      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          =   495
      Left            =   3240
      TabIndex        =   7
      Top             =   2160
      Width           =   855
   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          =   495
      Left            =   240
      TabIndex        =   5
      Top             =   2160
      Width           =   1095
   End
   Begin VB.Label Label3 
      Caption         =   "编号03CXS-"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3000
      TabIndex        =   3
      Top             =   1560
      Width           =   1575
   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            =   2400
      TabIndex        =   1
      Top             =   1560
      Width           =   375
   End
   Begin VB.Label Label1 
      Caption         =   "WFK-03计量综合自动化装置显示板测试记录表"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1920
      TabIndex        =   0
      Top             =   360
      Width           =   6495
   End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim h1, i1, j1, k1, l1, m1, n1 As Integer
Dim str As String


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 Command2_Click()
'Dim db As Database
'Dim rec As Recordset
'Set db = OpenDatabase(App.Path + "\wfk-03.mdb")
'Set rec = db.OpenRecordset("xianshiban")

'rec.AddNew
'rec!型 = Text1
'rec.Fields("编号") = Text2
'rec!底层按键和灯平齐 = Text3
'rec!线路板电源正常 = Text4
'rec!每秒运行正常 = Text5
'rec!汉字移入移出正常 = Text6
'rec!按键有效 = 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 = ""
If Text2.Text = "" Then
    l1 = 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 xianshiban where 编号 ='" & Text2.Text & " ' ")
    If rec.RecordCount > 0 Then
       m1 = MsgBox("确定要删除该记录", 4, "提示")
        If m1 = 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 xianshiban 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 = ""
        n1 = 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 xianshiban  where 编号= '" & Text2.Text & " ' ")
If Text2.Text = "" Then
    h1 = 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("按键有效"))
        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 = ""
        i1 = 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  xianshiban where 编号= '" & Text2.Text & " ' ")
If Text2.Text = "" Then
    j1 = MsgBox("请输入编号", 0, "提示")
Else
    If rec.RecordCount = 0 Then
        str = "insert into xianshiban ("
        str = str & "型,编号,底层按键和灯平齐,线路板电源正常,每秒运行正常,汉字移入移出正常,按键有效,"
        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
        k1 = MsgBox("是否覆盖以前的记录", 4, "提示")
        If k1 = 6 Then
        Set rec = db.OpenRecordset("select * from  xianshiban where 编号= '" & Text2.Text & " ' ")

        db.Execute "update xianshiban set 型 = '" & Text1.Text & " ' where 编号 = '" & rec.Fields("编号") & "'"
        db.Execute "update xianshiban set 底层按键和灯平齐 = '" & Text3.Text & " ' where 编号 = '" & rec.Fields("编号") & "'"
        
        db.Execute "update xianshiban set 线路板电源正常 = '" & Text4.Text & " ' where 编号 = '" & rec.Fields("编号") & "'"
        db.Execute "update xianshiban set 每秒运行正常 = '" & Text5.Text & " ' where 编号 = '" & rec.Fields("编号") & "'"
        db.Execute "update xianshiban set 汉字移入移出正常 = '" & Text6.Text & " ' where 编号 = '" & rec.Fields("编号") & "'"
        db.Execute "update xianshiban set 按键有效 = '" & Text7.Text & " ' where 编号 = '" & rec.Fields("编号") & "'"
        db.Execute "update xianshiban set 备注 = '" & Text8.Text & " ' where 编号 = '" & rec.Fields("编号") & "'"
        db.Execute "update xianshiban set 测试人 = '" & Text9.Text & " ' where 编号 = '" & rec.Fields("编号") & "'"
        db.Execute "update xianshiban set 测试日期 = '" & Text10.Text & " ' where 编号 = '" & rec.Fields("编号") & "'"
        db.Execute "update xianshiban set 检验人 = '" & Text11.Text & " ' where 编号 = '" & rec.Fields("编号") & "'"
        db.Execute "update xianshiban 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 = ""

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 Command6_Click()
Unload Me
Form1.Show
'Form1.Show
'Form6.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 Form_Unload(Cancel As Integer)
Unload Me
Form1.Show
End Sub

⌨️ 快捷键说明

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