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

📄 frmbqsl.frm

📁 用于电子行业打印复杂报表格式和不干胶标签
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   1200.189
         EndProperty
         BeginProperty Column03 
            ColumnWidth     =   1500.095
         EndProperty
         BeginProperty Column04 
            ColumnWidth     =   1695.118
         EndProperty
         BeginProperty Column05 
            ColumnWidth     =   1604.976
         EndProperty
         BeginProperty Column06 
            ColumnWidth     =   1604.976
         EndProperty
         BeginProperty Column07 
            ColumnWidth     =   1305.071
         EndProperty
      EndProperty
   End
   Begin VB.TextBox cc 
      DataField       =   "尺寸"
      DataSource      =   "Adodc1"
      Height          =   345
      Left            =   2010
      TabIndex        =   10
      Top             =   1260
      Width           =   1605
   End
   Begin VB.TextBox sl 
      DataField       =   "数量"
      DataSource      =   "Adodc1"
      Height          =   345
      Left            =   8970
      TabIndex        =   9
      Top             =   810
      Width           =   1695
   End
   Begin VB.ComboBox cbxh 
      DataField       =   "型号"
      DataSource      =   "Adodc1"
      Height          =   300
      ItemData        =   "frmbqsl.frx":0073
      Left            =   5490
      List            =   "frmbqsl.frx":0095
      TabIndex        =   8
      Top             =   810
      Width           =   1500
   End
   Begin VB.ComboBox cbbqfl 
      DataField       =   "标签分类"
      DataSource      =   "Adodc1"
      Height          =   300
      ItemData        =   "frmbqsl.frx":00EC
      Left            =   2010
      List            =   "frmbqsl.frx":00F9
      TabIndex        =   7
      Top             =   810
      Width           =   1695
   End
   Begin VB.Label Label7 
      Caption         =   "尺 寸:"
      Height          =   285
      Left            =   1020
      TabIndex        =   6
      Top             =   1290
      Width           =   855
   End
   Begin VB.Label Label6 
      Caption         =   "数 量:"
      Height          =   285
      Left            =   8070
      TabIndex        =   5
      Top             =   840
      Width           =   1005
   End
   Begin VB.Label Label5 
      Caption         =   "型 式:"
      Height          =   285
      Left            =   4650
      TabIndex        =   4
      Top             =   1290
      Width           =   1005
   End
   Begin VB.Label Label4 
      Caption         =   "型 号:"
      Height          =   285
      Left            =   4650
      TabIndex        =   3
      Top             =   840
      Width           =   1005
   End
   Begin VB.Label Label3 
      Caption         =   "盒内外:"
      Height          =   285
      Left            =   8070
      TabIndex        =   2
      Top             =   1290
      Width           =   1005
   End
   Begin VB.Label Label2 
      Caption         =   "标签分类:"
      Height          =   285
      Left            =   870
      TabIndex        =   1
      Top             =   840
      Width           =   1005
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Caption         =   "标签数量管理"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   4530
      TabIndex        =   0
      Top             =   120
      Width           =   3195
   End
End
Attribute VB_Name = "frmbqsl"
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
    cbbqfl.Enabled = True
    cbxh.Enabled = True
    sl.Enabled = True
    cc.Enabled = True
    xs.Enabled = True
    kh.Enabled = True
    cbbqfl.SetFocus
    cmdadd.Caption = "保存"
    cmdmod.Caption = "取消"
  Else
    If (Trim(cbbqfl.Text) = "" Or Trim(cbxh.Text) = "") Then
      MsgBox "标签分类和型号都不能为空!", 0 + 16, "提示窗"
      Exit Sub
    End If
    If Trim(kh.Text) = "" Then
      rstemp.Close
      rstemp.Open "select * from 标签数量表 where 标签分类='" & Trim(cbbqfl.Text) & "' and 型号='" & Trim(cbxh.Text) & "' and 型式='" & Trim(xs.Text) & "'", cnSys
      If rstemp.RecordCount > 0 Then
        MsgBox "该标签分类、型号、型式的记录已存在,请认真检查!", 0 + 16, "提示窗"
        cmdmod.Caption = "取消"
        cmdadd.Caption = "添加"
        Exit Sub
      End If
    End If
    Adodc1.Recordset.Update
    Adodc1.Recordset.Requery    '该语句非常重要,否则 Update 将出错
    cbbqfl.Enabled = False
    cbxh.Enabled = False
    sl.Enabled = False
    cc.Enabled = False
    xs.Enabled = False
    kh.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
    cbbqfl.Enabled = True
    cbxh.Enabled = True
    sl.Enabled = True
    cc.Enabled = True
    xs.Enabled = True
    kh.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
    cbbqfl.Enabled = False
    cbxh.Enabled = False
    sl.Enabled = False
    cc.Enabled = False
    xs.Enabled = False
    kh.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()
On Error Resume Next
    Set rstemp = New ADODB.Recordset   '初始化数据库
    rstemp.CursorType = adOpenKeyset
    rstemp.CursorLocation = adUseClient
    rstemp.LockType = adLockOptimistic
    rstemp.Open "select * from 标签数量表 ", cnSys

  Adodc1.ConnectionString = strConn
  Adodc1.RecordSource = "Select * From 标签数量表 order by 标签分类"
  Adodc1.Refresh
  
    cbbqfl.Enabled = False
    cbxh.Enabled = False
    sl.Enabled = False
    cc.Enabled = False
    xs.Enabled = False
    kh.Enabled = False
End Sub

⌨️ 快捷键说明

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