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

📄 productmove1.frm

📁 用VB做的一个数据库管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form ProductMove1 
   AutoRedraw      =   -1  'True
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "正在进行仓库调拨..."
   ClientHeight    =   4275
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9690
   Icon            =   "ProductMove1.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4275
   ScaleWidth      =   9690
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.PictureBox RightP 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BorderStyle     =   0  'None
      Height          =   480
      Left            =   4620
      MouseIcon       =   "ProductMove1.frx":08CA
      MousePointer    =   99  'Custom
      Picture         =   "ProductMove1.frx":0BD4
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   8
      ToolTipText     =   "增加产品"
      Top             =   1845
      Width           =   480
   End
   Begin VB.PictureBox LeftP 
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BorderStyle     =   0  'None
      Height          =   480
      Left            =   4575
      MouseIcon       =   "ProductMove1.frx":1016
      MousePointer    =   99  'Custom
      Picture         =   "ProductMove1.frx":1320
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   7
      ToolTipText     =   "撤消产品"
      Top             =   2535
      Width           =   480
   End
   Begin VB.CommandButton PreViouButton 
      Caption         =   "上一步(P)"
      Height          =   390
      Left            =   6270
      TabIndex        =   2
      Top             =   555
      Width           =   1050
   End
   Begin MSFlexGridLib.MSFlexGrid Grid2 
      Height          =   3000
      Left            =   135
      TabIndex        =   5
      Top             =   1155
      Width           =   4400
      _ExtentX        =   7752
      _ExtentY        =   5292
      _Version        =   393216
      Rows            =   10
      Cols            =   20
      BackColorSel    =   12648384
      ForeColorSel    =   8388608
      BackColorBkg    =   12632256
      AllowBigSelection=   0   'False
      FocusRect       =   0
      ScrollBars      =   2
      SelectionMode   =   1
   End
   Begin VB.CommandButton ExitButton 
      Caption         =   "退出(&X)"
      Height          =   390
      Left            =   8490
      TabIndex        =   1
      Top             =   555
      Width           =   1050
   End
   Begin VB.CommandButton NextButton 
      Caption         =   "下一步(&N)"
      Default         =   -1  'True
      Enabled         =   0   'False
      Height          =   390
      Left            =   7380
      TabIndex        =   0
      Top             =   555
      Width           =   1050
   End
   Begin MSFlexGridLib.MSFlexGrid Grid1 
      Height          =   3000
      Left            =   5175
      TabIndex        =   6
      Top             =   1155
      Width           =   4395
      _ExtentX        =   7752
      _ExtentY        =   5292
      _Version        =   393216
      Rows            =   10
      Cols            =   20
      BackColorSel    =   12648384
      ForeColorSel    =   8388608
      BackColorBkg    =   12632256
      AllowBigSelection=   0   'False
      FocusRect       =   0
      ScrollBars      =   2
      SelectionMode   =   1
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "第二步"
      ForeColor       =   &H000000FF&
      Height          =   180
      Left            =   450
      TabIndex        =   4
      Top             =   840
      Width           =   540
   End
   Begin VB.Label Label1 
      Caption         =   "    双击以下需要调拨的产品,然后按下一步按钮进行其它操作!如果该仓库没有产品将不能继续!"
      Height          =   405
      Left            =   165
      TabIndex        =   3
      Top             =   255
      Width           =   5955
   End
End
Attribute VB_Name = "ProductMove1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim RN As Single
Private Sub ExitButton_Click()
Unload Me
End Sub

Private Sub Form_Load()
Dim DB As Database, Ef As Recordset, HH As Integer
DbTrue = False
 '配置网格一
Grid2.Visible = False
Grid2.Cols = 4
Grid2.FormatString = "^ 序号 |^ 产品名称 |^ 数量 |^ 产品类型 "
Grid2.ColWidth(0) = 430
Grid2.ColWidth(1) = 1600
Grid2.ColWidth(2) = 800
Grid2.ColWidth(3) = 1200
    Set DB = OpenDatabase(App.Path & "\Sys\Store.mdb", 0, 0, Constr)
    Set Ef = DB.OpenRecordset("KCK", dbOpenTable)
        Grid2.Rows = Ef.RecordCount + 15
    Set Ef = DB.OpenRecordset("Select 产品名称,数量,产品类型,单位 From KCK WHERE 仓库类型='" & ResourceCK & "'", dbOpenDynaset)
        Dim TempStr As String
            TempStr = "Delete * From DayDbk"
            DB.Execute TempStr
            TempStr = "Delete * From DbKTemp"
            DB.Execute TempStr
            TempStr = "Insert into DayDbk Select 产品名称,数量,产品类型,单位 From KCK Where 仓库类型='" & ResourceCK & "'"
            DB.Execute TempStr
        HH = 1
        Do While Not Ef.EOF()
           Grid2.Row = HH
           Grid2.Col = 1
           Grid2.CellAlignment = 1
        If Not IsNull(Ef.Fields(0).Value) Then
           Grid2.Text = Ef.Fields(0).Value
        End If
           Grid2.Row = HH
           Grid2.Col = 2
           Grid2.CellAlignment = 1
        If Not IsNull(Ef.Fields(1).Value) Then
           Grid2.Text = Ef.Fields(1).Value
        End If
           Grid2.Row = HH
           Grid2.Col = 3
           Grid2.CellAlignment = 1
        If Not IsNull(Ef.Fields(2).Value) Then
           Grid2.Text = Ef.Fields(2).Value
        End If
          Ef.MoveNext
          HH = HH + 1
        Loop
        DB.Close
For HH = 1 To Grid2.Rows - 1
    Grid2.Row = HH
    Grid2.Col = 0
    Grid2.Text = HH
    If Len(Grid2.Text) = 1 Then
     Grid2.Text = "0" + Grid2.Text
     End If
 Next
 Grid2.Col = 1
 Grid2.Row = 1
 Grid2.ColSel = 3
 Grid2.Visible = True
  '配置网格
Grid1.Cols = 4
Grid1.FormatString = "^ 序号 |^ 产品名称 |^ 数量 |^ 产品类型 "
Grid1.ColWidth(0) = 430
Grid1.ColWidth(1) = 1600
Grid1.ColWidth(2) = 800
Grid1.ColWidth(3) = 1200
Grid1.Rows = Grid2.Rows
Grid1.ColSel = 3
End Sub


Private Sub Grid1_DblClick()
If Grid1.MouseCol = 0 Or Grid1.MouseRow = 0 Then Exit Sub
If Grid1.Text = "" Then
   Exit Sub
   Else
   Call LeftP_Click
   Exit Sub
End If
End Sub

Private Sub Grid2_DblClick()
If Grid2.MouseCol = 0 Or Grid2.MouseRow = 0 Then Exit Sub
If Grid2.Text = "" Then
   Exit Sub
   Else
   Call RightP_Click
   Exit Sub
End If
End Sub

Private Sub LeftP_Click()
If Grid1.Text = "" Then Exit Sub
ProductMove1.MousePointer = 11
RN = Grid1.Row
Dim DB As Database, Ef As Recordset, HH As Integer
Set DB = OpenDatabase(App.Path & "\Sys\Store.mdb", 0, 0, Constr)
Dim TempStr As String
    TempStr = "Insert into DayDbk Select 产品名称,数量,产品类型,单位 From KCK Where 产品名称='" & Grid1.Text & "' and 仓库类型='" & ResourceCK & "' and 产品类型='" & Grid1.TextMatrix(RN, 3) & "'"
    DB.Execute TempStr
    TempStr = "Delete * From DbkTemp Where 产品名称='" & Grid1.Text & "' and 产品类型='" & Grid1.TextMatrix(RN, 3) & "'"
    DB.Execute TempStr
 '配置网格一
Grid1.Visible = False
Grid1.Clear
Grid1.Cols = 4
Grid1.FormatString = "^ 序号 |^ 产品名称 |^ 数量 |^ 产品类型 "
Grid1.ColWidth(0) = 430
Grid1.ColWidth(1) = 1600
Grid1.ColWidth(2) = 800
Grid1.ColWidth(3) = 1200
    Set Ef = DB.OpenRecordset("DbKTemp", dbOpenTable)
        Grid1.Rows = Ef.RecordCount + 15
    Set Ef = DB.OpenRecordset("Select 产品名称,数量,产品类型,单位 From DbKTemp", dbOpenDynaset)
        HH = 1
        Do While Not Ef.EOF()
           Grid1.Row = HH
           Grid1.Col = 1
           Grid1.CellAlignment = 1
        If Not IsNull(Ef.Fields(0).Value) Then
           Grid1.Text = Ef.Fields(0).Value
        End If
           Grid1.Row = HH
           Grid1.Col = 2
           Grid1.CellAlignment = 1
        If Not IsNull(Ef.Fields(1).Value) Then
           Grid1.Text = Ef.Fields(1).Value
        End If
           Grid1.Row = HH
           Grid1.Col = 3
           Grid1.CellAlignment = 1
        If Not IsNull(Ef.Fields(2).Value) Then
           Grid1.Text = Ef.Fields(2).Value
        End If
          Ef.MoveNext
          HH = HH + 1
        Loop
        DB.Close
For HH = 1 To Grid1.Rows - 1
    Grid1.Row = HH
    Grid1.Col = 0
    Grid1.Text = HH
    If Len(Grid1.Text) = 1 Then
     Grid1.Text = "0" + Grid1.Text
     End If
 Next
 Grid1.Col = 1
 Grid1.Row = 1
 Grid1.ColSel = 3
 Grid1.Visible = True
  If Grid1.Text = "" Then
    NextButton.Enabled = False
    Else
    NextButton.Enabled = True
 End If
 '配置网格二
 Grid2.Visible = False
 Grid2.Cols = 4
 Grid2.Clear
 Grid2.FormatString = "^ 序号 |^ 产品名称 |^ 数量 |^ 产品类型 "
 Grid2.ColWidth(0) = 430
 Grid2.ColWidth(1) = 1600
 Grid2.ColWidth(2) = 800
 Grid2.ColWidth(3) = 1200
 Set DB = OpenDatabase(App.Path & "\Sys\Store.mdb", 0, 0, Constr)
 Set Ef = DB.OpenRecordset("DayDbK", dbOpenTable)
        Grid2.Rows = Ef.RecordCount + 15
    Set Ef = DB.OpenRecordset("Select 产品名称,数量,产品类型,单位 From DayDbK", dbOpenDynaset)
        HH = 1
        Do While Not Ef.EOF()
           Grid2.Row = HH
           Grid2.Col = 1
           Grid2.CellAlignment = 1
        If Not IsNull(Ef.Fields(0).Value) Then
           Grid2.Text = Ef.Fields(0).Value
        End If
           Grid2.Row = HH
           Grid2.Col = 2
           Grid2.CellAlignment = 1
        If Not IsNull(Ef.Fields(1).Value) Then
           Grid2.Text = Ef.Fields(1).Value
        End If
           Grid2.Row = HH
           Grid2.Col = 3
           Grid2.CellAlignment = 1
        If Not IsNull(Ef.Fields(2).Value) Then
           Grid2.Text = Ef.Fields(2).Value
        End If
          Ef.MoveNext
          HH = HH + 1
        Loop
        DB.Close
For HH = 1 To Grid2.Rows - 1
    Grid2.Row = HH
    Grid2.Col = 0
    Grid2.Text = HH
    If Len(Grid2.Text) = 1 Then
     Grid2.Text = "0" + Grid2.Text
     End If
 Next
 Grid2.Col = 1
 Grid2.Row = 1
 Grid2.ColSel = 3
 Grid2.Visible = True
 ProductMove1.MousePointer = 0

End Sub

Private Sub NextButton_Click()
ProductMove1.MousePointer = 11
Unload Me
MDIForm1.MousePointer = 11
ProductMove3.Show 1
End Sub

Private Sub PreViouButton_Click()
Unload Me
ProductMove.Show 1
End Sub

Private Sub RightP_Click()
If Grid2.MouseCol = 0 Or Grid2.MouseRow = 0 Or Grid2.Text = "" Then Exit Sub
ProductMove1.MousePointer = 11
RowNumber = Grid2.Row
'安装 数量
ProductMove2.Show 1
If DbTrue = False Then
   ProductMove1.MousePointer = 0
   Exit Sub
End If
RN = Grid2.Row
Dim DB As Database, Ef As Recordset, HH As Integer
Set DB = OpenDatabase(App.Path & "\Sys\Store.mdb", 0, 0, Constr)
Dim TempStr As String
    TempStr = "Insert into DbKTemp Select 产品名称,数量,产品类型,单位 From DayDbK Where 产品名称='" & Grid2.Text & "' and 产品类型='" & Grid2.TextMatrix(RN, 3) & "'"
    DB.Execute TempStr
    TempStr = "Update DbkTemp set 数量=" & DbNumber & " Where 产品名称='" & Grid2.Text & "' and 产品类型='" & Grid2.TextMatrix(RN, 3) & "'"
    DB.Execute TempStr
    TempStr = "Delete * From DayDbk Where 产品名称='" & Grid2.Text & "' and 产品类型='" & Grid2.TextMatrix(RN, 3) & "'"
    DB.Execute TempStr

 '配置网格一
Grid2.Visible = False
Grid2.Clear
Grid2.Cols = 4
Grid2.FormatString = "^ 序号 |^ 产品名称 |^ 数量 |^ 产品类型"
Grid2.ColWidth(0) = 430
Grid2.ColWidth(1) = 1600
Grid2.ColWidth(2) = 800
Grid2.ColWidth(3) = 1200
    Set Ef = DB.OpenRecordset("DayDbK", dbOpenTable)
        Grid2.Rows = Ef.RecordCount + 15
    Set Ef = DB.OpenRecordset("Select 产品名称,数量,产品类型,单位 From DayDbK", dbOpenDynaset)
        HH = 1
        Do While Not Ef.EOF()
           Grid2.Row = HH
           Grid2.Col = 1
           Grid2.CellAlignment = 1
        If Not IsNull(Ef.Fields(0).Value) Then
           Grid2.Text = Ef.Fields(0).Value
        End If
           Grid2.Row = HH
           Grid2.Col = 2
           Grid2.CellAlignment = 1
        If Not IsNull(Ef.Fields(1).Value) Then
           Grid2.Text = Ef.Fields(1).Value
        End If
           Grid2.Row = HH
           Grid2.Col = 3
           Grid2.CellAlignment = 1
        If Not IsNull(Ef.Fields(2).Value) Then
           Grid2.Text = Ef.Fields(2).Value
        End If
          Ef.MoveNext
          HH = HH + 1
        Loop
        DB.Close
For HH = 1 To Grid2.Rows - 1
    Grid2.Row = HH
    Grid2.Col = 0
    Grid2.Text = HH
    If Len(Grid2.Text) = 1 Then
     Grid2.Text = "0" + Grid2.Text
     End If
 Next
 Grid2.Col = 1
 Grid2.Row = 1
 Grid2.ColSel = 3
 Grid2.Visible = True
 '配置网格二
 Grid1.Visible = False
 Grid1.Cols = 4
 Grid1.Clear
 Grid1.FormatString = "^ 序号 |^ 产品名称 |^ 数量 |^ 产品类型"
 Grid1.ColWidth(0) = 430
 Grid1.ColWidth(1) = 1600
 Grid1.ColWidth(2) = 800
 Grid1.ColWidth(3) = 1200
 Set DB = OpenDatabase(App.Path & "\Sys\Store.mdb", 0, 0, Constr)
 Set Ef = DB.OpenRecordset("DbKTemp", dbOpenTable)
        Grid1.Rows = Ef.RecordCount + 15
    Set Ef = DB.OpenRecordset("Select 产品名称,数量,产品类型,单位 From DbKTemp", dbOpenDynaset)
        HH = 1
        Do While Not Ef.EOF()
           Grid1.Row = HH
           Grid1.Col = 1
           Grid1.CellAlignment = 1
        If Not IsNull(Ef.Fields(0).Value) Then
           Grid1.Text = Ef.Fields(0).Value
        End If
           Grid1.Row = HH
           Grid1.Col = 2
           Grid1.CellAlignment = 1
        If Not IsNull(Ef.Fields(1).Value) Then
           Grid1.Text = Ef.Fields(1).Value
        End If
           Grid1.Row = HH
           Grid1.Col = 3
           Grid1.CellAlignment = 1
        If Not IsNull(Ef.Fields(2).Value) Then
           Grid1.Text = Ef.Fields(2).Value
        End If
          Ef.MoveNext
          HH = HH + 1
        Loop
        DB.Close
For HH = 1 To Grid1.Rows - 1
    Grid1.Row = HH
    Grid1.Col = 0
    Grid1.Text = HH
    If Len(Grid1.Text) = 1 Then
     Grid1.Text = "0" + Grid1.Text
     End If
 Next
 Grid1.Col = 1
 Grid1.Row = 1
 Grid1.ColSel = 3
 Grid1.Visible = True
  If Grid1.Text = "" Then
    NextButton.Enabled = False
    Else
    NextButton.Enabled = True
 End If
 ProductMove1.MousePointer = 0
End Sub

⌨️ 快捷键说明

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