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

📄 form2.frm

📁 吐血上传的,质量技术监督局用计量器具管理数据库,具有建库、管库、修改信息、打印卡片等功能
💻 FRM
📖 第 1 页 / 共 3 页
字号:
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         Caption         =   "号"
         Height          =   180
         Left            =   2400
         TabIndex        =   14
         Top             =   1320
         Width           =   180
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         Caption         =   "字第"
         Height          =   180
         Left            =   1440
         TabIndex        =   13
         Top             =   1320
         Width           =   360
      End
      Begin VB.Label Label2 
         Alignment       =   2  'Center
         AutoSize        =   -1  'True
         Caption         =   "检  定  证  书"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   15
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF8080&
         Height          =   300
         Left            =   510
         TabIndex        =   2
         Top             =   840
         Width           =   2115
      End
      Begin VB.Label Label1 
         Alignment       =   2  'Center
         AutoSize        =   -1  'True
         ForeColor       =   &H00FF8080&
         Height          =   180
         Left            =   1515
         TabIndex        =   1
         Top             =   480
         Width           =   105
      End
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "按设备号查询"
      Height          =   180
      Left            =   3480
      TabIndex        =   11
      Top             =   240
      Width           =   1080
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim d As Boolean
    d = fun_chaxun(neirong(9).Text, 0)
        If d = True Then
            MsgBox "记录已经存在,请更改“设备编号”", , Form1.Adodc1.Recordset("caption")
        Else
            Adodc1.Recordset.AddNew
            Adodc1.Recordset("字第") = neirong(0).Text
            Adodc1.Recordset("号") = neirong(1).Text
            Adodc1.Recordset("计量器具名称") = neirong(2).Text
            Adodc1.Recordset("型号规格") = neirong(3).Text
            Adodc1.Recordset("测量范围") = neirong(4).Text
            Adodc1.Recordset("精度级别") = neirong(5).Text
            Adodc1.Recordset("制造单位") = neirong(6).Text
            Adodc1.Recordset("出厂器号") = neirong(7).Text
            Adodc1.Recordset("送检单位") = neirong(8).Text
            Adodc1.Recordset("设备编号") = neirong(9).Text
            Adodc1.Recordset("结论") = neirong(10).Text
            Adodc1.Recordset("检验员") = neirong(11).Text
            Adodc1.Recordset("核验") = neirong(12).Text
            Adodc1.Recordset("主管人") = neirong(13).Text
            Adodc1.Recordset("检定日期") = neirong(14).Text
            Adodc1.Recordset("有效期") = neirong(15).Text
            Adodc1.Recordset("温度") = Text3.Text
            
            
           ' Adodc1.Refresh
            Adodc1.Recordset.Update
            
            
        End If
End Sub

Private Sub Command2_Click()
            Adodc1.Recordset("字第") = neirong(0).Text
            Adodc1.Recordset("号") = neirong(1).Text
            Adodc1.Recordset("计量器具名称") = neirong(2).Text
            Adodc1.Recordset("型号规格") = neirong(3).Text
            Adodc1.Recordset("测量范围") = neirong(4).Text
            Adodc1.Recordset("精度级别") = neirong(5).Text
            Adodc1.Recordset("制造单位") = neirong(6).Text
            Adodc1.Recordset("出厂器号") = neirong(7).Text
            Adodc1.Recordset("送检单位") = neirong(8).Text
            Adodc1.Recordset("设备编号") = neirong(9).Text
            Adodc1.Recordset("结论") = neirong(10).Text
            Adodc1.Recordset("检验员") = neirong(11).Text
            Adodc1.Recordset("核验") = neirong(12).Text
            Adodc1.Recordset("主管人") = neirong(13).Text
            Adodc1.Recordset("检定日期") = neirong(14).Text
            Adodc1.Recordset("有效期") = neirong(15).Text
            Adodc1.Recordset("温度") = Text3.Text
            
            Adodc1.Recordset.Update
            
End Sub

Private Sub Command3_Click()
    Adodc1.Recordset.Delete
End Sub

Private Sub Command4_Click()
    Form3.Caption = Form1.Adodc1.Recordset("caption")
    Form3.Show 1
End Sub

Private Sub Command5_Click()
Unload Form1
Unload Form2
Unload Form3
End Sub

Private Function fun_chaxun(chaxun As Integer, showmsg As Integer) As Boolean
    fun_chaxun = True
    Adodc1.Recordset.MoveFirst
    Do Until Adodc1.Recordset("设备编号") = chaxun
        Adodc1.Recordset.MoveNext
        If Adodc1.Recordset.EOF = True Then
            If showmsg <> 0 Then
                MsgBox "记录不存在", , Form1.Adodc1.Recordset("caption")
            End If
            fun_chaxun = False
            Exit Do
        End If
    Loop
   ' datagrid1.
End Function

Private Sub Command6_Click()
Dim d As Boolean
    d = fun_chaxun(Text1.Text, 3)
    If d = True Then
            
            neirong(0).Text = Adodc1.Recordset("字第")
            neirong(1).Text = Adodc1.Recordset("号")
            neirong(2).Text = Adodc1.Recordset("计量器具名称")
            neirong(3).Text = Adodc1.Recordset("型号规格")
            neirong(4).Text = Adodc1.Recordset("测量范围")
            neirong(5).Text = Adodc1.Recordset("精度级别")
            neirong(6).Text = Adodc1.Recordset("制造单位")
            neirong(7).Text = Adodc1.Recordset("出厂器号")
            neirong(8).Text = Adodc1.Recordset("送检单位")
            neirong(9).Text = Adodc1.Recordset("设备编号")
            neirong(10).Text = Adodc1.Recordset("结论")
            neirong(11).Text = Adodc1.Recordset("检验员")
            neirong(12).Text = Adodc1.Recordset("核验")
            neirong(13).Text = Adodc1.Recordset("主管人")
            neirong(14).Text = Adodc1.Recordset("检定日期")
            neirong(15).Text = Adodc1.Recordset("有效期")
            Text3.Text = Adodc1.Recordset("温度")
    End If
End Sub

Private Sub DataGrid1_Click()
            neirong(0).Text = Adodc1.Recordset("字第")
            neirong(1).Text = Adodc1.Recordset("号")
            neirong(2).Text = Adodc1.Recordset("计量器具名称")
            neirong(3).Text = Adodc1.Recordset("型号规格")
            neirong(4).Text = Adodc1.Recordset("测量范围")
            neirong(5).Text = Adodc1.Recordset("精度级别")
            neirong(6).Text = Adodc1.Recordset("制造单位")
            neirong(7).Text = Adodc1.Recordset("出厂器号")
            neirong(8).Text = Adodc1.Recordset("送检单位")
            neirong(9).Text = Adodc1.Recordset("设备编号")
            neirong(10).Text = Adodc1.Recordset("结论")
            neirong(11).Text = Adodc1.Recordset("检验员")
            neirong(12).Text = Adodc1.Recordset("核验")
            neirong(13).Text = Adodc1.Recordset("主管人")
            neirong(14).Text = Adodc1.Recordset("检定日期")
            neirong(15).Text = Adodc1.Recordset("有效期")
            Text3.Text = Adodc1.Recordset("温度")
End Sub

Private Sub Form_Load()
Dim lc As Integer, tc As Integer, w As Integer, h As Integer
Move 0, 0, Screen.Width, Screen.Height
SSTab1.Move Form2.Width * 0.01, Form2.Height * 0.01, Form2.Width / 2, Form2.Height * 0.88
'Label1.Width = SSTab1.Width - 100
Label1.Move (SSTab1.Width - Label1.Width) / 2, SSTab1.Top + SSTab1.Height * 0.05
Label2.Move (SSTab1.Width - Label2.Width) / 2, SSTab1.Top + SSTab1.Height * 0.1
Label1.Caption = Form1.Adodc1.Recordset("caption")
lc = Form2.Width * 0.53
w = Form2.Width / 16
h = 0.05 * Form2.Height
tc = Form2.Height
Command1.Move lc, 0.2 * tc, w, h
Command2.Move lc, 0.3 * tc, w, h
Command3.Move lc, 0.4 * tc, w, h
Command4.Move lc, 0.5 * tc, w, h
Command5.Move lc, 0.7 * tc, w, h
DataGrid1.Move Form2.Width * 0.62, Form2.Height * 0.08, Form2.Width * 0.37, Form2.Height * 0.81
Label3.Move Form2.Width * 0.62, 0.02 * tc
Text1.Move Form2.Width * 0.72, 0.02 * tc, Form2.Width / 12, 0.03 * Form2.Height
Command6.Move Form2.Width * 0.82, 0.01 * tc, w, h
Text2.Move SSTab1.Width * 0.01, SSTab1.Height * 0.04, SSTab1.Width * 0.98, SSTab1.Height * 0.8
Label6.Move SSTab1.Width * 0.1, SSTab1.Height * 0.9
Text3.Move SSTab1.Width * 0.24, SSTab1.Height * 0.9, SSTab1.Width * 0.05, 50
Label7.Move SSTab1.Width * 0.3, SSTab1.Height * 0.9
Label8.Move SSTab1.Width * 0.1, SSTab1.Height * 0.95
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
lc = SSTab1.Width
tc = SSTab1.Height
neirong(0).Move 0.38 * lc, 0.2 * tc, 0.05 * lc, 50
neirong(1).Move 0.5 * lc, 0.2 * tc, 0.1 * lc, 50
Label4.Move 0.44 * lc, 0.2 * tc
Label5.Move 0.6 * lc, 0.2 * tc
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
For w = 0 To 7
    xiangmu(w).Move 0.25 * lc, 0.05 * (w + 5) * tc
    neirong(w + 2).Move 0.45 * lc, 0.05 * (w + 5) * tc, 0.3 * lc, 50
Next w
xiangmu(8).Move 0.02 * lc, 0.05 * 13 * tc
neirong(10).Move 0.02 * lc, 0.048 * 14 * tc, 0.96 * lc, 50
xiangmu(9).Move 0.9 * lc, 0.0505 * 14 * tc
For w = 10 To 12
    xiangmu(w).Move 0.7 * lc, 0.05 * (w + 5) * tc
    neirong(w + 1).Move 0.8 * lc, 0.05 * (w + 5) * tc, 0.1 * lc, 50
Next w
For w = 13 To 14
    xiangmu(w).Move 0.25 * lc, 0.05 * (w + 5) * tc
    neirong(w + 1).Move 0.45 * lc, 0.05 * (w + 5) * tc, 0.4 * lc, 50
Next w
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
SSTab1.Tab = 0
Text2.Visible = False
For w = 0 To 14
    xiangmu(w).Visible = True
    neirong(w).Visible = True
Next w
neirong(15).Visible = True
Label6.Visible = False
Label7.Visible = False
Label8.Visible = False
Text3.Visible = False
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim c As Column
For Each c In DataGrid1.Columns
    c.Width = 0.24 * DataGrid1.Width
    Select Case c.DataField
        Case "id"
            c.Visible = True
            c.Caption = "序号"
        Case "设备编号"
            c.Visible = True
          '  c.Text = RGB(0, 0, 200)
        Case "字第"
            c.Visible = True
        Case "号"
            c.Visible = True
        Case Else
            c.Visible = False
    End Select
Next c
End Sub

Private Sub SSTab1_Click(PreviousTab As Integer)
Select Case PreviousTab
    Case 1:
        Text2.Visible = False
        For w = 0 To 14
            xiangmu(w).Visible = True
            neirong(w).Visible = True
        Next w
        neirong(15).Visible = True
        Label6.Visible = False
        Label7.Visible = False
        Label8.Visible = False
        Text3.Visible = False
    Case 0:
        Text2.Visible = True
        For w = 0 To 14
            xiangmu(w).Visible = False
            neirong(w).Visible = False
        Next w
        neirong(15).Visible = True
        Label6.Visible = True
        Label7.Visible = True
        Label8.Visible = True
        Text3.Visible = True
End Select
End Sub

⌨️ 快捷键说明

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