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

📄 frmabfw.frm

📁 用于电子行业打印复杂报表格式和不干胶标签
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      BeginProperty Column05 
         DataField       =   "安标全称"
         Caption         =   "安标全称"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column06 
         DataField       =   "安标简称"
         Caption         =   "安标简称"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column07 
         DataField       =   "熔断电流"
         Caption         =   "熔断电流"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
            Object.Visible         =   0   'False
            ColumnWidth     =   2085.166
         EndProperty
         BeginProperty Column01 
            ColumnWidth     =   1500.095
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   1200.189
         EndProperty
         BeginProperty Column03 
            ColumnWidth     =   1200.189
         EndProperty
         BeginProperty Column04 
            ColumnWidth     =   1200.189
         EndProperty
         BeginProperty Column05 
            ColumnWidth     =   1500.095
         EndProperty
         BeginProperty Column06 
            ColumnWidth     =   1500.095
         EndProperty
         BeginProperty Column07 
            ColumnWidth     =   1200.189
         EndProperty
      EndProperty
   End
   Begin VB.Label Label8 
      Caption         =   "高电流:"
      Height          =   225
      Left            =   3300
      TabIndex        =   17
      Top             =   960
      Width           =   855
   End
   Begin VB.Label Label7 
      Caption         =   "低电流:"
      Height          =   225
      Left            =   780
      TabIndex        =   16
      Top             =   960
      Width           =   795
   End
   Begin VB.Label Label6 
      Caption         =   "熔断电流:"
      Height          =   225
      Left            =   5940
      TabIndex        =   5
      Top             =   960
      Width           =   915
   End
   Begin VB.Label Label5 
      Caption         =   "安标全称:"
      Height          =   225
      Left            =   8580
      TabIndex        =   4
      Top             =   600
      Width           =   915
   End
   Begin VB.Label Label4 
      Caption         =   "安标简称:"
      Height          =   225
      Left            =   5940
      TabIndex        =   3
      Top             =   600
      Width           =   915
   End
   Begin VB.Label Label3 
      Caption         =   "电   压:"
      Height          =   225
      Left            =   3210
      TabIndex        =   2
      Top             =   600
      Width           =   885
   End
   Begin VB.Label Label2 
      Caption         =   "安标型号:"
      Height          =   225
      Left            =   600
      TabIndex        =   1
      Top             =   600
      Width           =   915
   End
   Begin VB.Label Label1 
      Caption         =   "安标范围管理"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   4920
      TabIndex        =   0
      Top             =   150
      Width           =   1605
   End
End
Attribute VB_Name = "frmabfw"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rsTemp As ADODB.Recordset
Private Sub cmdadd_Click()
  On Error Resume Next
  
  If cmdadd.Caption = "添加" Then
    Adodc1.Recordset.AddNew
    abxh.Enabled = True
    dy.Enabled = True
    abjc.Enabled = True
    abqc.Enabled = True
    rddl.Enabled = True
    ddl.Enabled = True
    gdl.Enabled = True
    abxh.SetFocus
    cmdadd.Caption = "保存"
    cmdmod.Caption = "取消"
  Else
    If (Trim(abxh.Text) = "" Or Trim(dy.Text) = "" Or Trim(abjc.Text) = "" Or Trim(ddl.Text) = "" Or Trim(gdl.Text) = "") Then
      MsgBox "安标型号、电压、电流、安标简称都不能为空!", 0 + 16, "提示窗"
      Exit Sub
    End If
    rsTemp.Close
    rsTemp.Open "select * from 安标范围表 where 型号='" & Trim(abxh.Text) & "' and 电压='" & Trim(dy.Text) & "' and 安标简称='" & Trim(abjc.Text) & "'  And 低电流 =" & Val(Trim(ddl.Text)), cnSys
    If rsTemp.RecordCount > 0 Then
      MsgBox "该安标型号、电压、电流、安标的记录已存在,请认真检查!", 0 + 16, "提示窗"
      cmdmod.Caption = "取消"
      cmdadd.Caption = "添加"
      Exit Sub
    End If
    Adodc1.Recordset.Update
    Adodc1.Recordset.Requery    '该语句非常重要,否则 Update 将出错
    abxh.Enabled = False
    dy.Enabled = False
    abjc.Enabled = False
    abqc.Enabled = False
    rddl.Enabled = False
    ddl.Enabled = False
    gdl.Enabled = False
    cmdadd.Caption = "添加"
    cmdmod.Caption = "修改"
  End If

End Sub

Private Sub cmddel_Click()
  On Error Resume Next
  
  If Adodc1.Recordset.RecordCount > 0 Then
    If MsgBox("确定要删除该记录吗?", 4 + 32, "删除确认") = 6 Then
      Adodc1.Recordset.Delete
      Adodc1.Recordset.MoveNext
      If Adodc1.Recordset.RecordCount > 0 Then Adodc1.Recordset.MoveLast
    End If
  Else
    MsgBox "记录已为空!", 0 + 64, "信息窗"
  End If
End Sub

Private Sub cmdexit_Click()
  Unload Me
End Sub

Private Sub cmdmod_Click()
  On Error Resume Next

  If cmdmod.Caption = "修改" Then
    abxh.Enabled = True
    dy.Enabled = True
    abjc.Enabled = True
    abqc.Enabled = True
    rddl.Enabled = True
    ddl.Enabled = True
    gdl.Enabled = True
    varMark = Adodc1.Recordset.Bookmark    '记下当前记录的位置
    cmdmod.Caption = "保存"
    Exit Sub
  End If
  If cmdmod.Caption = "保存" Then
    Adodc1.Recordset.Update
    Adodc1.Recordset.Requery
    Adodc1.Recordset.Bookmark = varMark
    abxh.Enabled = False
    dy.Enabled = False
    abjc.Enabled = False
    abqc.Enabled = False
    rddl.Enabled = False
    ddl.Enabled = False
    gdl.Enabled = False
    cmdmod.Caption = "修改"
    Exit Sub
  End If
 If cmdmod.Caption = "取消" Then
   Adodc1.Recordset.Delete
   cmdmod.Caption = "修改"
   Exit Sub
 End If
End Sub

Private Sub cmdsch_Click()
On Error Resume Next
  tabname = "安标范围表"
  If cmdsch.Caption = "查找" Then
    frmSearch.Show vbModal
    If strQuery <> "" Then
      Adodc1.RecordSource = strQuery
      Adodc1.Refresh
      cmdsch.Caption = "重置"
    End If
  Else
    strQuery = "Select * From " & tabname
    Adodc1.RecordSource = strQuery
    Adodc1.Refresh
    cmdsch.Caption = "查找"
  End If
End Sub

Private Sub Form_Load()
Dim abfwxh As String
  On Error Resume Next
    abfwxh = "无"
    Set rsTemp = New ADODB.Recordset   '初始化数据库
    rsTemp.CursorType = adOpenKeyset
    rsTemp.CursorLocation = adUseClient
    rsTemp.LockType = adLockOptimistic
    rsTemp.Open "select * from 安标范围表 where 型号='" & abfwxh & "' ", cnSys

  
    Adodc1.ConnectionString = strConn
    Adodc1.RecordSource = "Select * From 安标范围表"
    Adodc1.Refresh
  
    abxh.Enabled = False
    dy.Enabled = False
    abjc.Enabled = False
    abqc.Enabled = False
    rddl.Enabled = False
    ddl.Enabled = False
    gdl.Enabled = False
End Sub

⌨️ 快捷键说明

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