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

📄 frmyzlok.frm

📁 小型超市进销存系统
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmYZLOK 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "清单结算"
   ClientHeight    =   11145
   ClientLeft      =   -165
   ClientTop       =   330
   ClientWidth     =   15270
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   11145
   ScaleWidth      =   15270
   Begin VB.TextBox txtCash 
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   21.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   6360
      TabIndex        =   9
      Top             =   7920
      Width           =   2895
   End
   Begin VB.Label Label9 
      AutoSize        =   -1  'True
      Caption         =   "现金:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   5040
      TabIndex        =   11
      Top             =   8160
      Width           =   945
   End
   Begin VB.Label Label10 
      AutoSize        =   -1  'True
      Caption         =   "元"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   9720
      TabIndex        =   10
      Top             =   8160
      Width           =   315
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      Caption         =   "实收现金:"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   21.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   1920
      TabIndex        =   8
      Top             =   3120
      Visible         =   0   'False
      Width           =   2010
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      Caption         =   "99999.00"
      BeginProperty Font 
         Name            =   "Trebuchet MS"
         Size            =   60
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   1500
      Left            =   4080
      TabIndex        =   7
      Top             =   2520
      Visible         =   0   'False
      Width           =   5370
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      Caption         =   "元"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   21.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   9720
      TabIndex        =   6
      Top             =   3120
      Visible         =   0   'False
      Width           =   450
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      Caption         =   "找零:"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   21.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   2040
      TabIndex        =   5
      Top             =   4920
      Visible         =   0   'False
      Width           =   1095
   End
   Begin VB.Label Label8 
      AutoSize        =   -1  'True
      Caption         =   "99.99"
      BeginProperty Font 
         Name            =   "Trebuchet MS"
         Size            =   60
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   1500
      Left            =   4080
      TabIndex        =   4
      Top             =   4320
      Visible         =   0   'False
      Width           =   3255
   End
   Begin VB.Label Label13 
      AutoSize        =   -1  'True
      Caption         =   "元"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   21.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   7680
      TabIndex        =   3
      Top             =   4800
      Visible         =   0   'False
      Width           =   450
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      Caption         =   "元"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   36
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   720
      Left            =   12360
      TabIndex        =   2
      Top             =   1080
      Width           =   735
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "9999999.99"
      BeginProperty Font 
         Name            =   "Trebuchet MS"
         Size            =   72
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   1545
      Left            =   3840
      TabIndex        =   1
      Top             =   600
      Width           =   8085
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "合计:"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   36
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   720
      Left            =   1920
      TabIndex        =   0
      Top             =   1080
      Width           =   1845
   End
End
Attribute VB_Name = "frmYZLOK"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim M As Boolean

Private Sub cmdBack_Click()
    Unload Me
End Sub

'Private Sub cmdOK_Click()
'Dim strsql As String
'    Dim x As Single
'    If Val(Text2.Text) > Val(Label2.Caption) Then
'        MsgBox "刷卡钱数错误,请核对!", vbExclamation
'        Text2.SetFocus
'        Text2.SelStart = 0
'        Text2.SelLength = 8
'        Exit Sub
'    End If
'
'    If Val(Text2.Text) + Val(Text1.Text) > Val(Label2.Caption) Then
'        MsgBox "输入错误,请核对!", vbExclamation
'        Text1.SetFocus
'        Text1.SelStart = 0
'        Text1.SelLength = 9
'        Exit Sub
'    Else
'        Val (txtCash.Text) + Val(Text2.Text) + Val(Text1.Text) > Val(Label2.Caption)
'        MsgBox "输入错误,请核对!", vbExclamation
'        txtCash.SetFocus
'        txtCash.SelStart = 0
'        txtCash.SelLength = 9
'        Exit Sub
'    End If
'
'    Label5.Caption = txtCash.Text
'    Label6.Left = Label6.Left + Label6.Width + 50
'
'    x = Val(Label2.Caption) - Val(Text1.Text) - Val(Text2.Text)
'    Label8.Caption = x
'    Label13.Left = Label13.Left + Label13.Width + 50
'
'    Label13.Visible = True
'
'    Label4.Visible = True
'    Label5.Visible = True
'    Label6.Visible = True
'    Label7.Visible = True
'    Label8.Visible = True
'
'End Sub

Private Sub Form_Load()
    Label2.Caption = frmYZLSale.lblSum.Caption
    xSum = Val(Label2.Caption)
    Label3.Left = Label2.Left + Label2.Width + 100
End Sub

'Private Sub Text1_GotFocus()
'    txtCash.BackColor = &H8000000F
'    Text1.BackColor = vbWhite
'    Text2.BackColor = &H8000000F
'End Sub
'
'
'Private Sub Text2_GotFocus()
'    txtCash.BackColor = &H8000000F
'    Text1.BackColor = &H8000000F
'    Text2.BackColor = vbWhite
'End Sub
'
'Private Sub txtCash_GotFocus()
'    txtCash.BackColor = vbWhite
'    Text1.BackColor = &H8000000F
'    Text2.BackColor = &H8000000F
'End Sub

Private Sub txtCash_KeyPress(KeyAscii As Integer)
Dim yu As Single
Dim stasql As String
    If KeyAscii <> 46 And KeyAscii <> 13 Then
        KeyAscii = KPress(KeyAscii)
    End If
    If KeyAscii = 13 Then
        If M = False Then
            If Val(txtCash.Text) < Val(Label2.Caption) Then
                MsgBox "金额不够!", vbExclamation
                txtCash.SetFocus
                txtCash.SelStart = 0
                txtCash.SelLength = 9
                Exit Sub
            Else
                Label5.Caption = txtCash.Text
                yu = Round(Val(txtCash.Text) - Val(Label2.Caption), 2)
                If yu < 1 Then
                Label8.Caption = "0" & yu
                Else
                Label8.Caption = yu
                End If
                Label13.Left = Label8.Left + Label8.Width + 50
                Label6.Left = Label5.Left + Label5.Width + 50
                Label4.Visible = True
                Label5.Visible = True
                Label6.Visible = True
                Label7.Visible = True
                Label8.Visible = True
                Label13.Visible = True
    
                strsql = "update t_sale set amoney=" & Val(Label2.Caption) & " where saleid='" & Trim(frmYZLSale.txtSaleID.Text) & "'"
                Dblink.executeSQL (strsql)
                M = True
            End If
        Else
            M = False
            strsql = "insert into t_sale values ('" & Now() & "','" & uName & "',0,'店面')"
            Dblink.executeSQL (strsql)
            
            strsql = "select top 1 saleid from t_sale order by saleid desc"
            Dblink.executeSQL (strsql)
            frmYZLSale.txtSaleID.Text = Dblink.rs.Fields(0).Value
            
            frmYZLSale.MSHFlexGrid1.Clear
            frmYZLSale.lblSum.Caption = ""
            frmYZLSale.lblGoodsname.Caption = ""
            frmYZLSale.lblSpec.Caption = ""
            frmYZLSale.lblUnit.Caption = ""
            frmYZLSale.lblOutprice.Caption = ""
            frmYZLSale.txtId.Text = ""
            frmYZLSale.txtNum.Text = "1"
            frmYZLSale.Text1.Text = ""
            Unload Me
        End If
    End If
End Sub

Private Function KPress(Kascii As Integer) As Integer
    If ((Kascii > 47 And Kascii < 58) Or Kascii = 8 Or Kascii = 13) Then
        KPress = Kascii
        Exit Function
    Else
        Kascii = 0
    End If
    KPress = Kascii
End Function

⌨️ 快捷键说明

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