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

📄 frmregxs.frm

📁 为一个公司
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmRegXS 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "出货销售登记"
   ClientHeight    =   3930
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6000
   BeginProperty Font 
      Name            =   "宋体"
      Size            =   9
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmRegXS.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3930
   ScaleWidth      =   6000
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.ComboBox cmbKhmc 
      Height          =   300
      Left            =   2295
      TabIndex        =   19
      Top             =   2835
      Width           =   2985
   End
   Begin VB.Frame Frame1 
      Height          =   1320
      Left            =   -45
      TabIndex        =   9
      Top             =   3195
      Width           =   6135
      Begin VB.CommandButton cmdCancel 
         Caption         =   "取消"
         Height          =   375
         Left            =   4590
         TabIndex        =   5
         Top             =   225
         Width           =   1230
      End
   End
   Begin VB.ComboBox cmbSpmc 
      Height          =   300
      Left            =   2295
      Locked          =   -1  'True
      TabIndex        =   8
      TabStop         =   0   'False
      Top             =   1395
      Width           =   2985
   End
   Begin VB.TextBox txtXsjg 
      Height          =   300
      Left            =   2295
      MaxLength       =   5
      TabIndex        =   1
      Top             =   1755
      Width           =   1410
   End
   Begin VB.TextBox txtXssl 
      Height          =   300
      Left            =   2295
      MaxLength       =   5
      TabIndex        =   2
      Top             =   2115
      Width           =   1410
   End
   Begin VB.CommandButton cmdCH 
      Caption         =   "出货"
      Enabled         =   0   'False
      Height          =   330
      Left            =   4140
      TabIndex        =   4
      Top             =   2340
      Width           =   1140
   End
   Begin VB.CommandButton cmdClear 
      Caption         =   "清空"
      Height          =   330
      Left            =   4140
      TabIndex        =   7
      TabStop         =   0   'False
      Top             =   1890
      Width           =   1140
   End
   Begin VB.ComboBox cmbSpdm 
      Height          =   300
      Left            =   2295
      Locked          =   -1  'True
      TabIndex        =   6
      TabStop         =   0   'False
      Top             =   1035
      Width           =   2985
   End
   Begin VB.TextBox txtHh 
      Height          =   300
      Left            =   2295
      MaxLength       =   25
      TabIndex        =   0
      Top             =   675
      Width           =   2985
   End
   Begin MSComCtl2.DTPicker dtpXsrq 
      Height          =   300
      Left            =   2295
      TabIndex        =   3
      Top             =   2475
      Width           =   1455
      _ExtentX        =   2566
      _ExtentY        =   529
      _Version        =   393216
      Format          =   23724033
      CurrentDate     =   38111
   End
   Begin VB.Label Label9 
      AutoSize        =   -1  'True
      Caption         =   "客户名称:"
      Height          =   180
      Left            =   1305
      TabIndex        =   18
      Top             =   2925
      Width           =   900
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "请填写出货登记信息"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000C0&
      Height          =   240
      Left            =   180
      TabIndex        =   17
      Top             =   135
      Width           =   2295
   End
   Begin VB.Label Label2 
      BackColor       =   &H00FFFFFF&
      Height          =   510
      Left            =   0
      TabIndex        =   16
      Top             =   0
      Width           =   6000
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "商品名称:"
      Height          =   180
      Left            =   1305
      TabIndex        =   15
      Top             =   1485
      Width           =   900
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "销售价格:"
      Height          =   180
      Left            =   1305
      TabIndex        =   14
      Top             =   1845
      Width           =   900
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      Caption         =   "销售数量:"
      Height          =   180
      Left            =   1305
      TabIndex        =   13
      Top             =   2205
      Width           =   900
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      Caption         =   "销售日期:"
      Height          =   180
      Left            =   1305
      TabIndex        =   12
      Top             =   2565
      Width           =   900
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      Caption         =   "商品代码:"
      Height          =   180
      Left            =   1305
      TabIndex        =   11
      Top             =   1125
      Width           =   900
   End
   Begin VB.Label Label8 
      AutoSize        =   -1  'True
      Caption         =   "货    号:"
      Height          =   180
      Left            =   1305
      TabIndex        =   10
      Top             =   720
      Width           =   900
   End
End
Attribute VB_Name = "frmRegXS"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdCancel_Click()
  Unload Me
End Sub

Private Sub cmdCH_Click()
  With rstMain
    If .State = adStateOpen Then .Close
    .Open "select * from spxx where hh='" & Trim(txtHh.Text) & "'"
    If txtXssl.Text > !kcsl & "" Then
      MsgBox "销售数量不能大于库存数量!", vbExclamation, "进销存系统"
      .Close
      Exit Sub
    End If
    !xssl = !xssl + txtXssl.Text
    !kcsl = !kcsl - txtXssl.Text
    .Update
    .Close
    
    .Open "select * from xsxx"
    .AddNew
    !hh = Trim(txtHh.Text)
    !xsrq = dtpXsrq.Value
    !xsdj = CCur(txtXsjg.Text)
    !xssl = txtXssl.Text
    !khmc = Trim(cmbKhmc.Text)
    .Update
    .Close
  End With
  cmdClear_Click
End Sub

Private Sub cmdClear_Click()
  txtHh.Text = ""
  cmbSpdm.Text = ""
  cmbSpmc.Text = ""
  txtXsjg.Text = ""
  txtXssl.Text = ""
  dtpXsrq.Value = Date$
  cmbKhmc.Text = ""
End Sub

Private Sub Form_Load()
  With rstMain
    If .State = adStateOpen Then .Close
    cmbSpdm.Clear
    cmbSpmc.Clear
    .Open "select * from spzd"
    If Not .BOF Then .MoveFirst
    While Not .EOF
      cmbSpdm.AddItem !spdm & ""
      cmbSpmc.AddItem !spmc & ""
      .MoveNext
    Wend
    .Close
    
    .Open "select * from khzd"
    If Not .BOF Then .MoveFirst
    While Not .EOF
      cmbKhmc.AddItem !khmc & ""
      .MoveNext
    Wend
    .Close
  End With
  dtpXsrq.Value = Date$
End Sub

Private Sub txtHh_Change()
  If Trim(txtHh.Text) <> "" And Trim(txtXsjg.Text) <> "" And Trim(txtXssl.Text) <> "" Then
    cmdCH.Enabled = True
  Else
    cmdCH.Enabled = False
  End If
End Sub

Private Sub txtHh_LostFocus()
  Dim intKey As Long
  
  With rstMain
    If .State = adStateOpen Then .Close
    .Open "select * from spxx where hh='" & Trim(txtHh.Text) & "'"
    If .BOF And .EOF Then
      If txtHh.Text <> "" Then
        MsgBox "没有此货号的商品,请重新输入货号!", vbExclamation, "进销存系统"
        txtHh.Text = ""
      End If
      Exit Sub
    Else
      intKey = !spzd_key
    End If
    .Close
    
    .Open "select * from spzd where spzd_key=" & intKey
    If Not .EOF Or Not .BOF Then
      cmbSpdm.Text = !spdm & ""
      cmbSpmc.Text = !spmc & ""
    End If
    .Close
  End With
End Sub

Private Sub txtXsjg_Change()
  If Trim(txtHh.Text) <> "" And Trim(txtXsjg.Text) <> "" And Trim(txtXssl.Text) <> "" Then
    cmdCH.Enabled = True
  Else
    cmdCH.Enabled = False
  End If
End Sub

Private Sub txtXssl_Change()
  If Trim(txtHh.Text) <> "" And Trim(txtXsjg.Text) <> "" And Trim(txtXssl.Text) <> "" Then
    cmdCH.Enabled = True
  Else
    cmdCH.Enabled = False
  End If
End Sub

Private Sub txtXsjg_KeyPress(KeyAscii As Integer)
  If KeyAscii <> Asc(0) And KeyAscii <> Asc(1) And KeyAscii <> Asc(2) And KeyAscii <> Asc(3) And KeyAscii <> Asc(4) And KeyAscii <> Asc(5) And KeyAscii <> Asc(6) And KeyAscii <> Asc(7) And KeyAscii <> Asc(8) And KeyAscii <> Asc(9) And KeyAscii <> 8 Then
    KeyAscii = 0
  End If
End Sub

Private Sub txtXssl_KeyPress(KeyAscii As Integer)
  If KeyAscii <> Asc(0) And KeyAscii <> Asc(1) And KeyAscii <> Asc(2) And KeyAscii <> Asc(3) And KeyAscii <> Asc(4) And KeyAscii <> Asc(5) And KeyAscii <> Asc(6) And KeyAscii <> Asc(7) And KeyAscii <> Asc(8) And KeyAscii <> Asc(9) And KeyAscii <> 8 Then
    KeyAscii = 0
  End If
End Sub

⌨️ 快捷键说明

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