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

📄 frmjinhuo.frm

📁 一个用VB写的服装进销存源码
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmjinhuo 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "进货单"
   ClientHeight    =   4815
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   6465
   Icon            =   "frmjinhuo.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4815
   ScaleWidth      =   6465
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.TextBox txtRukujia 
      Height          =   270
      Left            =   4440
      TabIndex        =   7
      Top             =   2160
      Width           =   1695
   End
   Begin VB.TextBox txthRen 
      Height          =   270
      Left            =   4440
      TabIndex        =   9
      Top             =   2640
      Width           =   1695
   End
   Begin VB.TextBox txtbak 
      Height          =   615
      Left            =   480
      TabIndex        =   10
      Top             =   3240
      Width           =   5655
   End
   Begin VB.ComboBox cmb 
      Height          =   300
      HelpContextID   =   2
      Index           =   1
      Left            =   4440
      TabIndex        =   3
      Tag             =   "准驾车型"
      Top             =   1200
      Width           =   1695
   End
   Begin VB.TextBox txthGuige 
      Height          =   270
      Left            =   1320
      TabIndex        =   4
      Tag             =   "驾驶证号"
      Top             =   1680
      Width           =   1935
   End
   Begin VB.TextBox txthName 
      Height          =   270
      Left            =   4440
      TabIndex        =   1
      Tag             =   "身份证号"
      Top             =   720
      Width           =   1695
   End
   Begin VB.TextBox txthNo 
      Height          =   270
      Left            =   1320
      TabIndex        =   0
      Tag             =   "从业资格证"
      Top             =   720
      Width           =   1935
   End
   Begin VB.ComboBox cmb 
      Height          =   300
      Index           =   0
      Left            =   1320
      TabIndex        =   2
      Top             =   1200
      Width           =   1935
   End
   Begin VB.TextBox txthNum 
      Height          =   270
      Left            =   1320
      TabIndex        =   6
      Top             =   2160
      Width           =   1935
   End
   Begin VB.ComboBox cmb 
      Height          =   300
      Index           =   2
      Left            =   4440
      TabIndex        =   5
      Top             =   1680
      Width           =   1695
   End
   Begin VB.Frame Frame3 
      Height          =   735
      Left            =   120
      TabIndex        =   14
      Top             =   3960
      Width           =   6255
      Begin VB.CommandButton cmdclose 
         Caption         =   "关闭(&C)"
         Height          =   375
         Left            =   4920
         TabIndex        =   13
         Top             =   240
         Width           =   1095
      End
      Begin VB.CommandButton cmdqing 
         Caption         =   "清空(&Q)"
         Height          =   375
         Left            =   3720
         TabIndex        =   12
         Top             =   240
         Width           =   1095
      End
      Begin VB.CommandButton cmdadd 
         Caption         =   "添加(&M)"
         Height          =   375
         Left            =   2520
         TabIndex        =   11
         Top             =   240
         Width           =   1095
      End
   End
   Begin MSComCtl2.DTPicker dt 
      Height          =   255
      Left            =   1320
      TabIndex        =   8
      Top             =   2640
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   450
      _Version        =   393216
      Format          =   25362433
      CurrentDate     =   38957
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      Caption         =   "入库价:"
      Height          =   180
      Left            =   3720
      TabIndex        =   26
      Top             =   2160
      Width           =   630
   End
   Begin VB.Label Label9 
      AutoSize        =   -1  'True
      Caption         =   "进货时间:"
      Height          =   180
      Left            =   480
      TabIndex        =   25
      Top             =   2640
      Width           =   810
   End
   Begin VB.Label Label10 
      AutoSize        =   -1  'True
      Caption         =   "进货人:"
      Height          =   180
      Left            =   3720
      TabIndex        =   24
      Top             =   2640
      Width           =   630
   End
   Begin VB.Label Label11 
      AutoSize        =   -1  'True
      Caption         =   "备注:"
      Height          =   180
      Left            =   480
      TabIndex        =   23
      Top             =   3000
      Width           =   450
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      Caption         =   "货品单位:"
      Height          =   180
      Left            =   3600
      TabIndex        =   22
      Tag             =   "准驾车型"
      Top             =   1200
      Width           =   810
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "货品规格:"
      Height          =   180
      Left            =   480
      TabIndex        =   21
      Tag             =   "驾驶证号"
      Top             =   1680
      Width           =   810
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "货品名称:"
      Height          =   180
      Left            =   3600
      TabIndex        =   20
      Tag             =   "身份证号"
      Top             =   720
      Width           =   810
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "货品编码:"
      Height          =   180
      Left            =   480
      TabIndex        =   19
      Tag             =   "从业资格证"
      Top             =   720
      Width           =   810
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "货品类别:"
      Height          =   180
      Left            =   480
      TabIndex        =   18
      Tag             =   "司机编号"
      Top             =   1200
      Width           =   810
   End
   Begin VB.Label Label8 
      AutoSize        =   -1  'True
      Caption         =   "进货数量:"
      Height          =   180
      Left            =   480
      TabIndex        =   17
      Top             =   2160
      Width           =   810
   End
   Begin VB.Label Label12 
      AutoSize        =   -1  'True
      Caption         =   "货品品牌:"
      Height          =   180
      Left            =   3600
      TabIndex        =   16
      Top             =   1680
      Width           =   810
   End
   Begin VB.Label Label13 
      AutoSize        =   -1  'True
      Caption         =   "进货单"
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   21.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   2640
      TabIndex        =   15
      Top             =   120
      Width           =   1350
   End
End
Attribute VB_Name = "frmjinhuo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdadd_Click() '添加进货信息到数据库
    Dim rs As New ADODB.Recordset
    Dim sql As String
    Dim sql1 As String
    Dim rs2 As New ADODB.Recordset
    Dim sql2 As String
    
    Dim hNum1 As String
    If Trim(txthRen.Text) = "" Then
        MsgBox "进货人不能为空!", 48, "信息提示"
        txthRen.SetFocus
        Exit Sub
    End If
    If Trim(txthNum.Text) = "" Then
        MsgBox "进货数量不能为空!", 48, "信息提示"
        txthNum.SetFocus
        Exit Sub
    End If
    sql = "select " & JINLU_TABLE_STR & " from jinhuojilu where jNo='" & Trim(txthNo.Text) & "'"
    rs.open sql, cn, adOpenDynamic, adLockOptimistic
    rs.AddNew
    rs!jshijian = dt.Value
    rs!jNo = Trim(txthNo.Text)
    rs!jren = Trim(txthRen.Text)
    rs!jRukujia = Trim(txtRukujia.Text)
    rs!jNum = Trim(txthNum.Text)
    rs!jBak = Trim(txtbak.Text)
    rs.Update
    rs.Close
    sql1 = "select " & HUOPIN_TABLE_STR & " from Huopin where hNo='" & Trim(txthNo.Text) & "'order by hNo "
    rs.open sql1, cn, adOpenDynamic, adLockOptimistic
    If rs.RecordCount < 1 Then '判断是否有重复的信息
    MsgBox "货品信息里不包括此名称!请先填加货品信息。", 48, "信息提示"
        Exit Sub
    End If
    hNum1 = Val(Trim(txthNum.Text)) + rs!hNum
    rs!hNum = hNum1
    rs.Update
    sql2 = "select " & HUOPIN_TABLE_STR1 & " from Huopin where hNo='" & Trim(txthNo.Text) & "'order by hNo "
    rs2.open sql2, cn, adOpenDynamic, adLockOptimistic
    rs2!jiecun = rs2!hNum * rs2!hRukujia
    rs2.Update
    MsgBox "添加记录成功!", 48, "信息提示"
End Sub

Private Sub qing() '定义清空内容选项
    txthNo.Text = ""
    txthGuige.Text = ""
    txthName.Text = ""
    txthNum.Text = ""
    txthRen.Text = ""
    txtRukujia.Text = ""
    txtbak.Text = ""
    cmb(0).Text = ""
    cmb(1).Text = ""
    cmb(2).Text = ""
End Sub

Private Sub cmdclose_Click()
    Unload Me
End Sub

Private Sub cmdqing_Click()
    Call qing
End Sub

Private Sub Form_Load()
    Dim rs As New ADODB.Recordset
    rs.open "select * from leibie", cn
    cmb(0).Clear
    Do While Not rs.EOF
        cmb(0).AddItem rs!leibie
        rs.MoveNext
    Loop
    rs.Close
    rs.open "select * from danwei", cn
    cmb(1).Clear
    Do While Not rs.EOF
        cmb(1).AddItem rs!danwei
        rs.MoveNext
    Loop
    rs.Close
    rs.open "select * from pinpai", cn
    cmb(2).Clear
    Do While Not rs.EOF
        cmb(2).AddItem rs!pinpai
        rs.MoveNext
    Loop
    rs.Close
     '调整日期为当前日期
    dt.Value = Format(Date, "yyyy-mm-dd")
End Sub

'Private Sub Form_Unload(Cancel As Integer)
'    Dim rs As New ADODB.Recordset
'    Dim sql As String
'    sql = "select " & HUOPIN_TABLE_STR & " from Huopin where hNo='" & Trim(txthNo.Text) & "'" 'HUOPIN_TABLE_STR是字段列表
'    rs.open sql, cn, adOpenDynamic, adLockOptimistic
'    rs!jiecun = rs!hNum * rs!hRukujia
'    rs.Update
'    rs.Close
'End Sub

Private Sub txthNo_KeyPress(KeyAscii As Integer)
    Dim rs As New ADODB.Recordset
    If Trim(txthNo.Text) <> "" And KeyAscii = 13 Then
        sql = "select * from Huopin where hNo='" & Trim(txthNo.Text) & "'"
        rs.open sql, cn
        If rs.RecordCount < 1 Then
            MsgBox "查无此编号!", 48, "信息提示"
            Call qing
            Exit Sub
        End If
    txthName.Text = rs!hName
    cmb(0).Text = rs!hLeibie
    cmb(1).Text = rs!hDanwei
    txthGuige.Text = rs!hGuige
    cmb(2).Text = rs!hPinpai
    txtRukujia.Text = rs!hRukujia
    txtbak.Text = rs!hbak
    txthNum.SetFocus
    End If
End Sub
Private Sub txthNum_KeyPress(KeyAscii As Integer)
    If Trim(txthNum.Text) <> "" And KeyAscii = 13 Then
        txthRen.SetFocus
    End If
    If KeyAscii = 8 Then
       Exit Sub
    End If
    If InStr("0123456789.", Chr(KeyAscii)) <= 0 Then
       KeyAscii = 0
    End If
End Sub

⌨️ 快捷键说明

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