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

📄 fmivta.frm

📁 利用Visual basic 构建POS进销存源码
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form FMIVTA 
   Caption         =   "盘点数据处理"
   ClientHeight    =   6975
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9105
   LinkTopic       =   "Form1"
   ScaleHeight     =   6975
   ScaleWidth      =   9105
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command3 
      Caption         =   "删除暂存档"
      Height          =   500
      Left            =   6840
      TabIndex        =   8
      Top             =   120
      Width           =   2175
   End
   Begin VB.CommandButton Command2 
      Caption         =   "转入暂存档"
      Height          =   500
      Left            =   4800
      TabIndex        =   7
      Top             =   120
      Width           =   1935
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Bindings        =   "FMIVTA.frx":0000
      Height          =   5655
      Left            =   4800
      TabIndex        =   6
      Top             =   720
      Width           =   4215
      _ExtentX        =   7435
      _ExtentY        =   9975
      _Version        =   393216
      HeadLines       =   1
      RowHeight       =   15
      FormatLocked    =   -1  'True
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   136
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   136
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   6
      BeginProperty Column00 
         DataField       =   "BGENO"
         Caption         =   "条码"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1028
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   "RBPST"
         Caption         =   "RBPST"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1028
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column02 
         DataField       =   "IACNT"
         Caption         =   "盘点数量"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1028
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column03 
         DataField       =   "IADAT"
         Caption         =   "日期"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1028
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column04 
         DataField       =   "IATME"
         Caption         =   "IATME"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1028
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column05 
         DataField       =   "IAMRK"
         Caption         =   "IAMRK"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1028
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
            ColumnWidth     =   1800
         EndProperty
         BeginProperty Column01 
            Object.Visible         =   0   'False
            ColumnWidth     =   1365.165
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   794.835
         EndProperty
         BeginProperty Column03 
            ColumnWidth     =   1005.165
         EndProperty
         BeginProperty Column04 
            ColumnWidth     =   915.024
         EndProperty
         BeginProperty Column05 
            ColumnWidth     =   2085.166
         EndProperty
      EndProperty
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   375
      Left            =   7200
      Top             =   6480
      Width           =   1695
      _ExtentX        =   2990
      _ExtentY        =   661
      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         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=POS.mdb;Persist Security Info=False"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=POS.mdb;Persist Security Info=False"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "SELECT * FROM IVTA"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   136
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.TextBox TB_BGCNT 
      Height          =   375
      Left            =   1920
      TabIndex        =   3
      Top             =   240
      Width           =   1095
   End
   Begin VB.TextBox TB_BGENO 
      Height          =   375
      Left            =   0
      TabIndex        =   2
      Top             =   240
      Width           =   1935
   End
   Begin VB.CommandButton Command1 
      Caption         =   "更新至表格"
      Height          =   500
      Left            =   3120
      TabIndex        =   1
      Top             =   120
      Width           =   1455
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   6135
      Left            =   0
      TabIndex        =   0
      Top             =   720
      Width           =   4575
      _ExtentX        =   8070
      _ExtentY        =   10821
      _Version        =   393216
      Cols            =   4
   End
   Begin VB.Label Label2 
      Caption         =   "数量"
      Height          =   255
      Left            =   2040
      TabIndex        =   5
      Top             =   0
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "产品条码"
      Height          =   375
      Left            =   120
      TabIndex        =   4
      Top             =   0
      Width           =   1575
   End
End
Attribute VB_Name = "FMIVTA"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public CN As New ADODB.Connection, RS As New ADODB.Recordset
Public SQL As String
Const DBPATH = "./POS.MDB"
Const ConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPATH

Dim TOTAL_REC As Integer

Private Sub Command1_Click()

  If (TB_BGENO.Text <> "") And (TB_BGCNT.Text <> "") Then
  
     CN.Open ConnString
     SQL = "SELECT * FROM BGDS "
     SQL = SQL & "WHERE BGENO = '" & TB_BGENO.Text & "' "
     RS.Open SQL, ConnString, , , adCmdText
    
     If RS.EOF = False Then
        TOTAL_REC = TOTAL_REC + 1
        MSFlexGrid1.Rows = TOTAL_REC + 1
  
        MSFlexGrid1.TextMatrix(TOTAL_REC, 0) = TOTAL_REC
        MSFlexGrid1.TextMatrix(TOTAL_REC, 1) = TB_BGENO.Text
        MSFlexGrid1.TextMatrix(TOTAL_REC, 2) = RS("BGNAM")
        MSFlexGrid1.TextMatrix(TOTAL_REC, 3) = TB_BGCNT.Text
        End If
   
 
     RS.Close
     CN.Close
  
     End If
  
   TB_BGENO.SetFocus
   SendKeys "{Home}+{End}"
End Sub

Private Sub Command2_Click()
  CN.Open ConnString

  For I = 1 To TOTAL_REC
  
     SQL = "SELECT * FROM IVTA "
     SQL = SQL & "WHERE BGENO = '" & MSFlexGrid1.TextMatrix(I, 1) & "' "
     RS.Open SQL, ConnString, , , adCmdText
    
     If RS.EOF = False Then
       SQL = "       UPDATE IVTA "
       SQL = SQL & " SET "
       SQL = SQL & "  IACNT = IACNT + " & MSFlexGrid1.TextMatrix(I, 3) & " "
       SQL = SQL & " WHERE BGENO = '" & MSFlexGrid1.TextMatrix(I, 1) & "' "
       CN.Execute SQL
       Else
       SQL = "      INSERT INTO IVTA "
       SQL = SQL & "(BGENO, RBPST, IACNT, IADAT, IATME )"
       SQL = SQL & " VALUES ( "
       SQL = SQL & " '" & MSFlexGrid1.TextMatrix(I, 1) & "' , "
       SQL = SQL & " '" & "001" & "' , "
       SQL = SQL & " '" & MSFlexGrid1.TextMatrix(I, 3) & "' , "
       SQL = SQL & " '" & Date & "'  , "
       SQL = SQL & " '" & Mid(Time, 3, 5) & "'    "
       SQL = SQL & " ) "
       CN.Execute SQL
       End If
   
 
     RS.Close
  
     Next
    
  CN.Close
  
  TOTAL_REC = 0
  MSFlexGrid1.Rows = 1
  
  MsgBox "锣

⌨️ 快捷键说明

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