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

📄 form4.frm

📁 打印方面的程序
💻 FRM
📖 第 1 页 / 共 4 页
字号:
            Left            =   7200
            TabIndex        =   34
            Top             =   1920
            Width           =   1095
         End
         Begin VB.Label jine 
            BackStyle       =   0  'Transparent
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   10.5
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Index           =   3
            Left            =   7200
            TabIndex        =   33
            Top             =   2520
            Width           =   1095
         End
         Begin VB.Label jine 
            BackStyle       =   0  'Transparent
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   10.5
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Index           =   4
            Left            =   7200
            TabIndex        =   32
            Top             =   3120
            Width           =   1095
         End
      End
      Begin MSAdodcLib.Adodc Adodc1 
         Height          =   615
         Left            =   10440
         Top             =   6600
         Visible         =   0   'False
         Width           =   1335
         _ExtentX        =   2355
         _ExtentY        =   1085
         ConnectMode     =   0
         CursorLocation  =   3
         IsolationLevel  =   -1
         ConnectionTimeout=   15
         CommandTimeout  =   30
         CursorType      =   3
         LockType        =   3
         CommandType     =   2
         CursorOptions   =   0
         CacheSize       =   50
         MaxRecords      =   0
         BOFAction       =   0
         EOFAction       =   0
         ConnectStringType=   1
         Appearance      =   1
         BackColor       =   -2147483643
         ForeColor       =   -2147483640
         Orientation     =   0
         Enabled         =   -1
         Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\wupinguanli\wupin.mdb;Persist Security Info=False"
         OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\wupinguanli\wupin.mdb;Persist Security Info=False"
         OLEDBFile       =   ""
         DataSourceName  =   ""
         OtherAttributes =   ""
         UserName        =   ""
         Password        =   ""
         RecordSource    =   "tmp_add"
         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 VB.Label Label8 
         BackStyle       =   0  'Transparent
         Caption         =   "(     )第       号"
         Height          =   255
         Left            =   9000
         TabIndex        =   68
         Top             =   1440
         Width           =   2055
      End
      Begin VB.Label Label7 
         BackStyle       =   0  'Transparent
         Caption         =   "年       月       日"
         Height          =   255
         Left            =   4920
         TabIndex        =   67
         Top             =   1440
         Width           =   2775
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "制单:"
         Height          =   255
         Index           =   3
         Left            =   9240
         TabIndex        =   66
         Top             =   6240
         Width           =   615
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "经手:"
         Height          =   255
         Index           =   2
         Left            =   6480
         TabIndex        =   65
         Top             =   6240
         Width           =   615
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "验收:"
         Height          =   255
         Index           =   1
         Left            =   3960
         TabIndex        =   64
         Top             =   6240
         Width           =   615
      End
      Begin VB.Label Label4 
         BackStyle       =   0  'Transparent
         Caption         =   "部门主管"
         Height          =   255
         Index           =   0
         Left            =   480
         TabIndex        =   63
         Top             =   6240
         Width           =   735
      End
      Begin VB.Line Line5 
         X1              =   1200
         X2              =   2880
         Y1              =   1700
         Y2              =   1700
      End
      Begin VB.Line Line4 
         X1              =   1200
         X2              =   2880
         Y1              =   1100
         Y2              =   1100
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "保管部门:"
         Height          =   255
         Index           =   1
         Left            =   360
         TabIndex        =   62
         Top             =   1440
         Width           =   975
      End
      Begin VB.Label Label3 
         BackStyle       =   0  'Transparent
         Caption         =   "使用单位:"
         Height          =   255
         Index           =   0
         Left            =   360
         TabIndex        =   61
         Top             =   840
         Width           =   1215
      End
      Begin VB.Line Line3 
         X1              =   3840
         X2              =   7680
         Y1              =   1125
         Y2              =   1125
      End
      Begin VB.Line Line2 
         X1              =   3840
         X2              =   7680
         Y1              =   1080
         Y2              =   1080
      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
         Height          =   375
         Left            =   3960
         TabIndex        =   60
         Top             =   720
         Width           =   3375
      End
      Begin VB.Line Line1 
         BorderWidth     =   2
         X1              =   3480
         X2              =   8040
         Y1              =   600
         Y2              =   600
      End
      Begin VB.Label Label1 
         Alignment       =   2  'Center
         BackColor       =   &H00FFFFFF&
         BackStyle       =   0  'Transparent
         Caption         =   "山  东  科  技  大  学"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3240
         TabIndex        =   59
         Top             =   240
         Width           =   5295
      End
   End
   Begin MSAdodcLib.Adodc Adodc4 
      Height          =   615
      Left            =   1560
      Top             =   5520
      Width           =   2055
      _ExtentX        =   3625
      _ExtentY        =   1085
      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         =   "Adodc2"
      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
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
     Adodc1.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.path + "\wupin.mdb;Persist Security Info=False"
      Adodc1.CommandType = adCmdText
      Adodc1.RecordSource = "select * from wupin where 单据号='" & Trim(Text4.Text) & "'"
      Adodc1.Refresh
      
      If Adodc1.Recordset.RecordCount <> 0 Then
         Adodc1.Recordset.MoveFirst
         
      If Not IsNull(Adodc1.Recordset("使用单位").Value) Then
         Text1(0).Text = Adodc1.Recordset("使用单位").Value                           '将使用单位清空
      End If
      If Not IsNull(Adodc1.Recordset("保管部门").Value) Then
         Text2(1).Text = Adodc1.Recordset("保管部门").Value                            '将保管部门清空
      End If
      If Not IsNull(Adodc1.Recordset("部门主管").Value) Then
         Text3(0).Text = Adodc1.Recordset("部门主管").Value                             '将部门主管清空
      End If
      If Not IsNull(Adodc1.Recordset("验收人").Value) Then
         Text3(1).Text = Adodc1.Recordset("验收人").Value                              '将验收人清空
      End If
      If Not IsNull(Adodc1.Recordset("经手人").Value) Then
         Text3(2).Text = Adodc1.Recordset("经手人").Value                               '将经手人清空
      End If
      If Not IsNull(Adodc1.Recordset("制单").Value) Then
         Text3(3).Text = Adodc1.Recordset("制单").Value                                 '将制单人清空
      End If
           
      Label7.Caption = CStr(Year(Adodc1.Recordset("时间").Value)) + "年" + CStr(Month(Adodc1.Recordset("时间").Value)) + "月" + CStr(Day(Adodc1.Recordset("时间").Value)) + "日"

      Label8.Caption = "(" & Mid(Adodc1.Recordset("单据号").Value, 1, 4) & ")" & "第" & Mid(Adodc1.Recordset("单据号").Value, 5, 4) & "号"        '将最终的表单编号显示出来

      
         For i = 0 To Adodc1.Recordset.RecordCount - 1
             If Not IsNull(Adodc1.Recordset("编号").Value) Then
                bianhao(i).Caption = Adodc1.Recordset("编号").Value
             End If
             If Not IsNull(Adodc1.Recordset("名称").Value) Then
                mingcheng(i).Text = Adodc1.Recordset("名称").Value
             End If
             If Not IsNull(Adodc1.Recordset("规格").Value) Then
                guige(i).Text = Adodc1.Recordset("规格").Value
             End If
             If Not IsNull(Adodc1.Recordset("数量").Value) Then
                danwei(i).Text = Adodc1.Recordset("数量").Value
             End If
             If Not IsNull(Adodc1.Recordset("单价").Value) Then
                danjia(i).Text = Adodc1.Recordset("单价").Value
             End If
             If Not IsNull(Adodc1.Recordset("金额").Value) Then
                jine(i).Caption = Adodc1.Recordset("金额").Value
             End If
             If Not IsNull(Adodc1.Recordset("备注").Value) Then
                beizhu(i).Text = Adodc1.Recordset("备注").Value
             End If
             Adodc1.Recordset.MoveNext
             
          Next i
          
     End If
     
    If Adodc1.Recordset.RecordCount = 0 Then
       MsgBox "要打印的验收单不存在!"
    End If


End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Command4_Click()

Dim ado As ADODB.Connection
Set ado = New ADODB.Connection
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Dim dbstring, sqlstring As String

dbstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.path & "\wupin.mdb"
ado.Open dbstring
sqlstring = "delete * from wupin where 单据号='" & Trim(Text4.Text) & "'"

Set rs = ado.Execute(sqlstring, 1, 1)


For ia = 0 To 4                                    '清空开始新的验收单
       mingcheng(ia).Text = ""
       guige(ia).Text = ""
       danwei(ia).Text = ""
       shuliang(ia).Text = ""
       danjia(ia).Text = ""
       jine(ia).Caption = ""
       beizhu(ia).Text = ""
       bianhao(ia) = ""
Next ia
      Text1(0).Text = ""                              '将使用单位清空
      Text2(1).Text = ""                              '将保管部门清空
      Text3(0).Text = ""                              '将部门主管清空
      Text3(1).Text = ""                              '将验收人清空
      Text3(2).Text = ""                              '将经手人清空
      Text3(3).Text = ""                              '将制单人清空

      Text4.Text = ""
End Sub

⌨️ 快捷键说明

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