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

📄 frmabgl.frm

📁 用于电子行业打印复杂报表格式和不干胶标签
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            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     =   1305.071
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   1500.095
         EndProperty
         BeginProperty Column03 
            ColumnWidth     =   1200.189
         EndProperty
         BeginProperty Column04 
            ColumnWidth     =   1200.189
         EndProperty
         BeginProperty Column05 
            ColumnWidth     =   1200.189
         EndProperty
         BeginProperty Column06 
            ColumnWidth     =   1500.095
         EndProperty
      EndProperty
   End
   Begin VB.Label Label8 
      Caption         =   "备注:"
      Height          =   225
      Left            =   6720
      TabIndex        =   19
      Top             =   750
      Visible         =   0   'False
      Width           =   675
   End
   Begin VB.Label Label7 
      Caption         =   " 以上数据以毫米为单位"
      Height          =   285
      Left            =   6480
      TabIndex        =   18
      Top             =   150
      Width           =   2175
   End
   Begin VB.Label Label6 
      Caption         =   "安标高度:"
      Height          =   225
      Left            =   4440
      TabIndex        =   17
      Top             =   750
      Width           =   915
   End
   Begin VB.Label Label5 
      Caption         =   "安标全称:"
      Height          =   225
      Left            =   2310
      TabIndex        =   16
      Top             =   180
      Width           =   915
   End
   Begin VB.Label Label4 
      Caption         =   "安标宽度:"
      Height          =   225
      Left            =   2310
      TabIndex        =   15
      Top             =   750
      Width           =   915
   End
   Begin VB.Label Label3 
      Caption         =   "安标图像:"
      Height          =   225
      Left            =   150
      TabIndex        =   13
      Top             =   750
      Width           =   915
   End
   Begin VB.Label Label2 
      Caption         =   "安标显示"
      Height          =   255
      Left            =   6900
      TabIndex        =   12
      Top             =   4860
      Visible         =   0   'False
      Width           =   825
   End
   Begin VB.Image pict_card 
      Height          =   495
      Left            =   5640
      Stretch         =   -1  'True
      Top             =   90
      Width           =   495
   End
   Begin VB.Label Label1 
      Caption         =   "安标简称:"
      Height          =   225
      Left            =   150
      TabIndex        =   0
      Top             =   180
      Width           =   915
   End
End
Attribute VB_Name = "frmabgl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rsTemp As ADODB.Recordset
Private Sub CmdClose_Click()
   Unload Me
End Sub

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

Private Sub cmdEdit_Click()
  On Error Resume Next

  If cmdedit.Caption = "修改" Then
    abmc.Enabled = True
    abqc.Enabled = True
    ablj.Enabled = True
    abkd.Enabled = True
    abgd.Enabled = True
    cmdpic.Enabled = True
    bz.Enabled = True
    varMark = Adoabgl.Recordset.Bookmark    '记下当前记录的位置
    cmdedit.Caption = "保存"
    Exit Sub
 End If
 If cmdedit.Caption = "保存" Then
    Adoabgl.Recordset.Update
    Adoabgl.Recordset.Requery
    Adoabgl.Recordset.Bookmark = varMark
    abmc.Enabled = False
    abqc.Enabled = False
    ablj.Enabled = False
    abkd.Enabled = False
    abgd.Enabled = False
    bz.Enabled = False
    cmdpic.Enabled = False
    cmdedit.Caption = "修改"
    Exit Sub
  End If
 If cmdedit.Caption = "取消" Then
  Adoabgl.Recordset.Delete
  cmdedit.Caption = "修改"
  Exit Sub
 End If
End Sub

Private Sub cmdpic_Click()
On Error Resume Next
  Dim sFile As String
  
  With dlgDialogpict
    .DialogTitle = "打开"
    .CancelError = False
    'ToDo: 设置 common dialog 控件的标志和属性
    .Filter = "图象文件 (*.bmp)|*.bmp|JPG文件(*.jpg)|*.jpg|ICO文件(*.ico)|*.ico"
    .ShowOpen
    If Len(.FileName) = 0 Then
      Exit Sub
    End If
    sFile = .FileTitle
   ' MsgBox vFldVal(.FileTitle), 0 + 64, "信息窗"
  End With

  ablj.Text = sFile    '储存图象文件名
  pict_card.Picture = LoadPicture(SystemDir & "\picture\" & sFile)
  Text1.Text = vFldVal(pict_card.Width)
  
  
End Sub
Private Sub cmdadd_Click()
  On Error Resume Next
  
  If cmdadd.Caption = "添加" Then
    Adoabgl.Recordset.AddNew
    abmc.Enabled = True
    abqc.Enabled = True
    ablj.Enabled = True
    abkd.Enabled = True
    abgd.Enabled = True
    bz.Enabled = True
    cmdpic.Enabled = True
    abmc.SetFocus
    cmdadd.Caption = "保存"
    cmdedit.Caption = "取消"
  Else
    If (Trim(abmc.Text) = "" Or Trim(abqc.Text) = "") Then
      MsgBox "安标简称和全称都不能为空!", 0 + 16, "提示窗"
      Exit Sub
    End If
    If Trim(ablj.Text) = "" Then
      MsgBox "安标图像不能为空!", 0 + 16, "提示窗"
      Exit Sub
    End If
    
    rsTemp.Close
    rsTemp.Open "select * from 安标表 where 安标简称='" & Trim(abmc.Text) & "'", cnSys
    If rsTemp.RecordCount > 0 Then
      MsgBox "该安标简称已存在,请认真检查!", 0 + 16, "提示窗"
      cmdedit.Caption = "取消"
      cmdadd.Caption = "添加"
      Exit Sub
    End If
    Adoabgl.Recordset.Update
    Adoabgl.Recordset.Requery    '该语句非常重要,否则 Update 将出错
    abmc.Enabled = False
    abqc.Enabled = False
    ablj.Enabled = False
    abkd.Enabled = False
    abgd.Enabled = False
    bz.Enabled = False
    cmdpic.Enabled = False
    cmdadd.Caption = "添加"
    cmdedit.Caption = "修改"
  End If

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

Private Sub DataGrid2_Click()
On Error Resume Next
  If Trim(abkd.Text) <> "" Then
    pict_card.Width = Val(abkd.Text) * stunit
  End If
  If Trim(abgd.Text) <> "" Then
    pict_card.Height = Val(abgd.Text) * stunit
  End If
  pict_card.Picture = LoadPicture(SystemDir & "\picture\" & Trim(ablj.Text))
  'Text1.Text = vFldVal(pict_card.Width)
End Sub

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

  Adoabgl.ConnectionString = strConn
  Adoabgl.RecordSource = "Select * From 安标表"
  Adoabgl.Refresh
  
  'abmc.Text = ""
  abmc.Enabled = False
  abqc.Enabled = False
  ablj.Enabled = False
  abkd.Enabled = False
  abgd.Enabled = False
  bz.Enabled = False
  cmdpic.Enabled = False
End Sub

⌨️ 快捷键说明

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