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

📄 form2.frm

📁 电子衡自动计量系统.能对电子汽车衡进行自动计量.完成车皮存储,重车自动除皮等功能.
💻 FRM
📖 第 1 页 / 共 3 页
字号:
      Caption         =   "说明:"
      Height          =   375
      Left            =   840
      TabIndex        =   12
      Top             =   4320
      Width           =   975
   End
   Begin VB.Label Label13 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "发货单位"
      Height          =   255
      Left            =   720
      TabIndex        =   11
      Top             =   3840
      Width           =   1095
   End
   Begin VB.Label Label12 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "发货人"
      Height          =   255
      Left            =   4920
      TabIndex        =   10
      Top             =   3240
      Width           =   975
   End
   Begin VB.Label Label10 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "开票时间"
      Height          =   255
      Left            =   720
      TabIndex        =   9
      Top             =   3240
      Width           =   1095
   End
   Begin VB.Label Label9 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "欠存量"
      Height          =   255
      Left            =   7680
      TabIndex        =   8
      Top             =   2400
      Width           =   1095
   End
   Begin VB.Label Label8 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "累计发运量"
      Height          =   255
      Left            =   6120
      TabIndex        =   7
      Top             =   2400
      Width           =   1215
   End
   Begin VB.Label Label7 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "合同量"
      Height          =   255
      Left            =   3120
      TabIndex        =   6
      Top             =   2400
      Width           =   1215
   End
   Begin VB.Label Label6 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "煤种"
      Height          =   255
      Left            =   1920
      TabIndex        =   5
      Top             =   2400
      Width           =   975
   End
   Begin VB.Label Label5 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "票号"
      Height          =   255
      Left            =   720
      TabIndex        =   4
      Top             =   2400
      Width           =   975
   End
   Begin VB.Line Line8 
      X1              =   7560
      X2              =   7560
      Y1              =   2280
      Y2              =   3120
   End
   Begin VB.Line Line7 
      X1              =   4560
      X2              =   4560
      Y1              =   2280
      Y2              =   3120
   End
   Begin VB.Line Line6 
      X1              =   6120
      X2              =   6120
      Y1              =   2280
      Y2              =   3120
   End
   Begin VB.Line Line5 
      X1              =   3120
      X2              =   3120
      Y1              =   2280
      Y2              =   3120
   End
   Begin VB.Line Line3 
      X1              =   720
      X2              =   9120
      Y1              =   4080
      Y2              =   4080
   End
   Begin VB.Line Line2 
      X1              =   720
      X2              =   9000
      Y1              =   3600
      Y2              =   3600
   End
   Begin VB.Line Line1 
      X1              =   720
      X2              =   9000
      Y1              =   2640
      Y2              =   2640
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Label4"
      Height          =   180
      Left            =   1560
      TabIndex        =   3
      Top             =   1920
      Width           =   540
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "时间:"
      Height          =   255
      Left            =   720
      TabIndex        =   2
      Top             =   1920
      Width           =   735
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "煤 炭 发 运 欠 存 单"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   375
      Left            =   2400
      TabIndex        =   1
      Top             =   1560
      Width           =   5415
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "微山崔庄煤矿有限公司"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   375
      Left            =   2400
      TabIndex        =   0
      Top             =   1320
      Width           =   5415
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim llen As Integer
Private Sub Combo1_Click()
On Error Resume Next
Me.Text2.Text = Me.Combo1.Text
Me.Combo1.Visible = False
Me.Text2.Visible = True
Me.Adodc1.RecordSource = "SELECT sum(jz) FROM " & jl_sqlstr & " WHERE hth='" & Trim(Me.Combo1.Text) & "' and   sj like '%" & Format(Now, "yyyy-mm-dd") & "%'"
Me.Adodc1.refresh
Me.Label20.Caption = Me.Adodc1.Recordset.Fields(0)
Me.Adodc1.RecordSource = "SELECT * FROM htk WHERE hth='" & Trim(Me.Combo1.Text) & "' "
Me.Adodc1.refresh
Me.Label16.Caption = Me.Adodc1.Recordset.Fields("hwm")
Me.Label17.Caption = Me.Adodc1.Recordset.Fields("htl")
Me.Label18.Caption = Me.Adodc1.Recordset.Fields("yfl")
Me.Label21.Caption = Me.Adodc1.Recordset.Fields("wfl")
Me.Label22.Caption = Me.Adodc1.Recordset.Fields("sj")
Me.Label23.Caption = Me.Adodc1.Recordset.Fields("fhr")
Me.Label24.Caption = Me.Adodc1.Recordset.Fields("fhdw")
End Sub

Private Sub Command1_Click()
Me.Adodc2.RecordSource = "select 票号,数量,今日发出量,已发量,未发量,煤种,货主名姓 ,发货单位,时间,填票人,负责人  from htk2 where  票号='" & Trim(Text5.Text) & "'"
Me.Adodc2.refresh
Set Me.DataGrid1.DataSource = Me.Adodc2
End Sub

Private Sub Command2_Click()
Picture1.Visible = False
getdata
End Sub

Private Sub CurtButton1_Click()
Picture1.Visible = False
Me.Timer1.Enabled = True
Me.CurtButton3.Enabled = False

Me.CurtButton4.Enabled = False
Me.CurtButton5.Enabled = False
Me.CurtButton6.Enabled = False
 Me.Adodc2.RecordSource = "select * from htk2"
 Me.Adodc2.refresh
 Me.Label15.Caption = Format(Me.Adodc2.Recordset.RecordCount + 1, "000000")
End Sub

Private Sub CurtButton2_Click()
  Picture1.Visible = True
  Me.Timer1.Enabled = False
  Me.CurtButton3.Enabled = True
  Me.CurtButton4.Enabled = True
  Me.CurtButton5.Enabled = True
  Me.CurtButton6.Enabled = True
End Sub

Private Sub CurtButton3_Click()
On Error Resume Next
Me.Adodc2.Recordset.MoveFirst
getdata
End Sub

Private Sub CurtButton4_Click()
On Error Resume Next
Me.Adodc2.Recordset.MovePrevious
getdata
End Sub

Private Sub CurtButton5_Click()
On Error Resume Next
Me.Adodc2.Recordset.MoveNext
getdata
End Sub

Private Sub CurtButton6_Click()
On Error Resume Next
Me.Adodc2.Recordset.MoveLast
getdata
End Sub

Private Sub CurtButton7_Click()
'On Error Resume Next
Printer.Orientation = 1

For ii = 1 To 3
Form4.Label15(ii).Caption = Format(Me.Adodc2.Recordset.RecordCount + 1, "000000")

Form4.Label4(ii).Caption = Label4.Caption
Form4.Label16(ii).Caption = Label16.Caption
Form4.Label17(ii).Caption = Label17.Caption
Form4.Label18(ii).Caption = Label18.Caption
Form4.Label20(ii).Caption = Label20.Caption
Form4.Label21(ii).Caption = Label21.Caption
Form4.Label22(ii).Caption = Label22.Caption
Form4.Label23(ii).Caption = Label23.Caption
Form4.Label24(ii).Caption = Label24.Caption
Form4.Text1(ii).Text = Text1.Text
Form4.Text2(ii).Text = Text2.Text
Form4.Text3(ii).Text = Text3.Text
Form4.Text4(ii).Text = Text4.Text
Next ii
Form4.PrintForm
Printer.EndDoc
Me.Adodc2.RecordSource = "select * from htk2 where 时间 like '%" & Format(Now, "yyyy-mm-dd") & "%' and 票号='" & Trim(Text2.Text) & "'"
Me.Adodc2.refresh

If Me.Adodc2.Recordset.RecordCount > 0 Then
MsgBox "票号: " + Text2.Text + " 已打印过了."
Me.Adodc2.Recordset.Fields("时间") = Me.Label4.Caption
 Me.Adodc2.Recordset.Fields("票号") = Text2.Text
 Me.Adodc2.Recordset.Fields("数量") = Val(Label17.Caption)
 Me.Adodc2.Recordset.Fields("已发量") = Val(Label18.Caption)
 Me.Adodc2.Recordset.Fields("未发量") = Val(Label21.Caption)
 Me.Adodc2.Recordset.Fields("煤种") = Label16.Caption
 Me.Adodc2.Recordset.Fields("今日发出量") = Val(Label20.Caption)
 Me.Adodc2.Recordset.Fields("货主名姓") = Label23.Caption
 Me.Adodc2.Recordset.Fields("发货单位") = Label24.Caption
 Me.Adodc2.Recordset.Fields("填票人") = Text4.Text
Me.Adodc2.Recordset.Fields("负责人") = Text3.Text
Me.Adodc2.Recordset.Fields("开票时间") = Me.Label22.Caption

Me.Adodc2.Recordset.UpdateBatch adAffectAllChapters
Exit Sub
Else

Me.Adodc2.Recordset.AddNew
 Me.Adodc2.Recordset.Fields("时间") = Me.Label4.Caption
 Me.Adodc2.Recordset.Fields("票号") = Text2.Text
 Me.Adodc2.Recordset.Fields("数量") = Val(Label17.Caption)
 Me.Adodc2.Recordset.Fields("已发量") = Val(Label18.Caption)
 Me.Adodc2.Recordset.Fields("未发量") = Val(Label21.Caption)
 Me.Adodc2.Recordset.Fields("煤种") = Label16.Caption
 Me.Adodc2.Recordset.Fields("今日发出量") = Val(Label20.Caption)
 Me.Adodc2.Recordset.Fields("货主名姓") = Label23.Caption
 Me.Adodc2.Recordset.Fields("发货单位") = Label24.Caption
 Me.Adodc2.Recordset.Fields("填票人") = Text4.Text
Me.Adodc2.Recordset.Fields("负责人") = Text3.Text
Me.Adodc2.Recordset.Fields("开票时间") = Me.Label22.Caption

Me.Adodc2.Recordset.UpdateBatch adAffectAllChapters
Me.Adodc2.refresh
 Me.Label15.Caption = Format(Me.Adodc2.Recordset.RecordCount + 1, "000000")

End If

End Sub

Private Sub CurtButton8_Click()
Unload Me
End Sub

Private Sub CurtPrinter1_NeedRedraw()

End Sub

Private Sub Form_Load()
On Error Resume Next
Me.Adodc1.ConnectionString = connetstr
Me.Adodc1.RecordSource = "SELECT DISTINCT HTH FROM " & jl_sqlstr & " order by hth"
Me.Adodc1.refresh
llen = Adodc1.Recordset.RecordCount
Dim ii
If Me.Adodc1.Recordset.RecordCount > 0 Then
Me.Adodc1.Recordset.MoveFirst
For ii = 1 To llen
   'If IsNull(Adodc1.Recordset.Fields(0)) = False Then
  
   Me.Combo1.AddItem (Adodc1.Recordset.Fields(0))
   Me.Adodc1.Recordset.MoveNext
   'End If
 Next ii
 End If
 Me.Text4.Text = jl_sby
 Me.Adodc2.refresh
 Me.Label15.Caption = Format(Me.Adodc2.Recordset.RecordCount + 1, "000000")

 
End Sub

Private Sub Text2_Click()
Me.Combo1.Visible = True
Me.Text2.Visible = False
End Sub

Private Sub Timer1_Timer()
Me.Label4.Caption = Format(Now, "yyyy-mm-dd-hh-nn-ss")
End Sub
Private Sub getdata()
On Error Resume Next
 Me.Label4.Caption = Me.Adodc2.Recordset.Fields("时间")
 Text2.Text = Me.Adodc2.Recordset.Fields("票号")
 Label17.Caption = Me.Adodc2.Recordset.Fields("数量")
 Label18.Caption = Me.Adodc2.Recordset.Fields("已发量")
  Label21.Caption = Me.Adodc2.Recordset.Fields("未发量")
  Label16.Caption = Me.Adodc2.Recordset.Fields("煤种")
  Label20.Caption = Me.Adodc2.Recordset.Fields("今日发出量")
 Label23.Caption = Me.Adodc2.Recordset.Fields("货主名姓")
  Label24.Caption = Me.Adodc2.Recordset.Fields("发货单位")
   Text4.Text = Me.Adodc2.Recordset.Fields("填票人")
 Text3.Text = Me.Adodc2.Recordset.Fields("负责人")
 Label22.Caption = Me.Adodc2.Recordset.Fields("开票时间")
End Sub

⌨️ 快捷键说明

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