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

📄 frmmain.frm

📁 一个称重计量程序
💻 FRM
📖 第 1 页 / 共 3 页
字号:
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4320
         TabIndex        =   24
         Top             =   3000
         Width           =   855
      End
      Begin VB.Label Label11 
         Caption         =   "净重:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4320
         TabIndex        =   23
         Top             =   2520
         Width           =   855
      End
      Begin VB.Label Label10 
         Caption         =   "扣重:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   4320
         TabIndex        =   22
         Top             =   1920
         Width           =   855
      End
      Begin VB.Label Label9 
         Caption         =   "皮重:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4320
         TabIndex        =   21
         Top             =   960
         Width           =   855
      End
      Begin VB.Label Label8 
         Caption         =   "毛重:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   4320
         TabIndex        =   20
         Top             =   360
         Width           =   855
      End
      Begin VB.Label Label5 
         Caption         =   "仓库:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   480
         TabIndex        =   19
         Top             =   2520
         Width           =   975
      End
      Begin VB.Label Label4 
         Caption         =   "单位名称:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   480
         TabIndex        =   18
         Top             =   2040
         Width           =   1455
      End
      Begin VB.Label Label3 
         Caption         =   "货物名称:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   480
         TabIndex        =   17
         Top             =   960
         Width           =   1455
      End
      Begin VB.Label Label2 
         Caption         =   "车号:"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   480
         TabIndex        =   16
         Top             =   360
         Width           =   615
      End
   End
   Begin VB.TextBox TxtWeight 
      Alignment       =   1  'Right Justify
      BackColor       =   &H80000006&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   36
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000005&
      Height          =   825
      Left            =   240
      Locked          =   -1  'True
      TabIndex        =   1
      Text            =   "0"
      Top             =   120
      Width           =   2415
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   5520
      Top             =   5760
      Visible         =   0   'False
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSCommLib.MSComm Com 
      Left            =   5160
      Top             =   600
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DTREnable       =   -1  'True
      DataBits        =   7
   End
   Begin VB.Label Label1 
      Caption         =   "KG"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   36
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2760
      TabIndex        =   32
      Top             =   360
      Width           =   855
   End
   Begin VB.Label Label7 
      Caption         =   "诚信称重管理系统"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   42
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   6735
      Left            =   9840
      TabIndex        =   0
      Top             =   0
      Width           =   975
   End
End
Attribute VB_Name = "frmmain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Prtflag As Boolean
'//初始化各Cmb
Public Sub InitCmb(ByVal tbName As String, Cmbname As ComboBox)
On Error Resume Next
 Dim rdmy As New ADODB.Recordset
        Cmbname.Clear
         With rdmy
         .Open "select*from " & tbName, Cn, adOpenKeyset, adLockPessimistic
          Do Until .EOF
             Cmbname.AddItem .Fields(1).Value
           .MoveNext
          Loop
          .Close
         End With
End Sub
'//初始化数据
Private Sub InitData()
 cmbhw.ListIndex = -1
 Cmbdw.ListIndex = -1
 Cmbck.ListIndex = -1
 txtmz.Text = "0.00"
 TxtPz.Text = "0.00"
 TxtyS.Text = "0.00"
 Txtkz.Text = "0.00"
 Txtjz.Text = "0.00"
 Txthl.Text = "0.00"
 Chkdw.Value = 0
End Sub

Private Sub Chkdw_Click()
On Error Resume Next
Dim rddw As New ADODB.Recordset
If Chkdw.Value = 1 Then
  Cmbdw.Clear
  With rddw
   .Open "select*from tb_dw where 单位类型='拉货单位' order by 单位名称", Cn, adOpenKeyset, adLockPessimistic
     Do Until .EOF
      Cmbdw.AddItem .Fields!单位名称
     .MoveNext
     Loop
   .Close
  End With
  Chkdw.Caption = "拉货单位"
Else
    Cmbdw.Clear
  With rddw
   .Open "select*from tb_dw where 单位类型='送货单位' order by 单位名称", Cn, adOpenKeyset, adLockPessimistic
     Do Until .EOF
      Cmbdw.AddItem .Fields!单位名称
     .MoveNext
     Loop
   .Close
  End With
 Chkdw.Caption = "送货单位"
End If
End Sub

Private Sub Cmbck_Change()
Dim rdck As New ADODB.Recordset
 If IsNumeric(Trim(Cmbck)) = True Then
  With rdck
   .Open "select*from tb_CK where 仓库代号=" & CInt(Cmbck.Text), Cn, adOpenKeyset, adLockPessimistic
    If Not .EOF Then
      Cmbck.Text = .Fields!仓库名称
    End If
   .Close
  End With
End If
End Sub

Private Sub Cmbdw_Change()
Dim rddw As New ADODB.Recordset
 If IsNumeric(Trim(Cmbdw)) = True And Len(Trim(Cmbdw)) = 2 Then
  With rddw
   .Open "select*from tb_dw where Left(单位代号,2) = '" & Trim(Cmbdw.Text) & "'", Cn, adOpenKeyset, adLockPessimistic
    Cmbdw.Clear
    Do Until .EOF
      Cmbdw.AddItem .Fields!单位名称
      .MoveNext
    Loop
    If Not .EOF Then
      Cmbdw.ListIndex = 0
    End If
   .Close
  End With
End If
End Sub

Private Sub cmbhw_Change()
Dim rdHw As New ADODB.Recordset
 If IsNumeric(Trim(cmbhw)) = True And Len(Trim(cmbhw)) = 3 Then
  With rdHw
   .Open "select*from tb_hw where 货物代号='" & Trim(cmbhw.Text) & "'", Cn, adOpenKeyset, adLockPessimistic
    If Not .EOF Then
      cmbhw.Text = .Fields!货物名称
    End If
   .Close
  End With
End If
End Sub

Private Sub Cmdmz_Click()
On Error Resume Next
'If Chkdw.Value = 1 And CInt(TxtPz.Text) = 0 Then
'  MsgBox "是拉货单位,应该先过皮重!", vbInformation + vbOKOnly, "提示!"
'  Exit Sub
'End If
If Trim(TxtWeight.Text) = "" Then
  MsgBox "数据通讯不正常,不能采集毛重!", vbInformation + vbOKOnly, "提示"
  Exit Sub
End If

⌨️ 快捷键说明

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