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

📄 form1.frm

📁 一套鞋厂的仓库管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      TabIndex        =   16
      Top             =   1290
      Width           =   1335
   End
   Begin VB.Label Label4 
      Caption         =   "颜   色:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   15
      Top             =   1710
      Width           =   1335
   End
   Begin VB.Label Label5 
      Caption         =   "单  位:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3600
      TabIndex        =   14
      Top             =   1800
      Width           =   1215
   End
   Begin VB.Label Label6 
      Caption         =   "货品类别:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   13
      Top             =   480
      Width           =   1335
   End
   Begin VB.Label Label7 
      Caption         =   "库存类别:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   12
      Top             =   2115
      Width           =   1335
   End
   Begin VB.Label Label8 
      Caption         =   "期初库存:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3600
      TabIndex        =   11
      Top             =   2160
      Width           =   1095
   End
   Begin VB.Label Label10 
      Caption         =   "厂   商:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   10
      Top             =   2520
      Width           =   1335
   End
End
Attribute VB_Name = "frmdatamodify"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private rs As ADODB.Recordset
Private i As Integer
Private str As String


Private Sub comcancel_Click()
   If Trim(Me.ID) = "" Then
     Exit Sub
  End If
  Set rs = New ADODB.Recordset
  str = "SELECT stuffdatatable.id, stuffdatatable.helpcode, stuffdatatable.name, stuffdatatable.kind,stuffdatatable.color, stuffdatatable.unit, stuffclasstable.name AS stuffclass, libclasstable.memo as libclass, stuffdatatable.initlib, stuffdatatable.supply FROM stuffdatatable INNER JOIN stuffclasstable ON stuffdatatable.stuffclass = stuffclasstable.id INNER JOIN libclasstable ON stuffdatatable.libclass = libclasstable.name where stuffdatatable.id=" & Trim(Me.ID.Text)
  rs.Open str, GetConnect, adOpenDynamic, adLockOptimistic
  If rs.EOF And rs.BOF Then
     MsgBox "无此记录资料!"
     rs.Close
     Exit Sub
  Else
     Me.helpcode.Enabled = True
     Me.stuffname.Enabled = True
     Me.kind.Enabled = True
     Me.color.Enabled = True
     Me.unit.Enabled = True
     Me.stuffclass.Enabled = True
     Me.libclass.Enabled = True
     Me.initlib.Enabled = True
     Me.supply.Enabled = True
  
     Me.helpcode = Trim(rs![helpcode])
     Me.stuffname = Trim(rs![Name])
     Me.kind = Trim(rs![kind])
     Me.color.Text = Trim(rs![color])
     Me.unit = Trim(rs![unit])
     Me.stuffclass.Text = Trim(rs![stuffclass])
     Me.libclass.Text = Trim(rs![libclass])
     Me.initlib = Trim(rs![initlib])
     Me.supply.Text = Trim(rs![supply])
  End If
  rs.Close
   
End Sub


Private Sub comexit_Click()
Unload Me
End Sub

Private Sub Comfirst_Click()
    
End Sub

Private Sub comok_Click()
  If Trim(Me.ID) = "" Then
     Exit Sub
  End If
  Set rs = New ADODB.Recordset
  str = "SELECT stuffdatatable.id, stuffdatatable.helpcode, stuffdatatable.name, stuffdatatable.kind,stuffdatatable.color, stuffdatatable.unit, stuffclasstable.name AS stuffclass, libclasstable.memo as libclass, stuffdatatable.initlib, stuffdatatable.supply FROM stuffdatatable INNER JOIN stuffclasstable ON stuffdatatable.stuffclass = stuffclasstable.id INNER JOIN libclasstable ON stuffdatatable.libclass = libclasstable.name where stuffdatatable.id=" & Trim(Me.ID.Text)
  rs.Open str, GetConnect, adOpenDynamic, adLockOptimistic
  If rs.EOF And rs.BOF Then
     MsgBox "无此记录资料!"
     rs.Close
     Exit Sub
  Else
     Me.helpcode.Enabled = True
     Me.stuffname.Enabled = True
     Me.kind.Enabled = True
     Me.color.Enabled = True
     Me.unit.Enabled = True
     Me.stuffclass.Enabled = True
     Me.libclass.Enabled = True
     Me.initlib.Enabled = True
     Me.supply.Enabled = True
  
     Me.helpcode = Trim(rs![helpcode])
     Me.stuffname = Trim(rs![Name])
     Me.kind = Trim(rs![kind])
     Me.color.Text = Trim(rs![color])
     Me.unit = Trim(rs![unit])
     Me.stuffclass.Text = Trim(rs![stuffclass])
     Me.libclass.Text = Trim(rs![libclass])
     Me.initlib = Trim(rs![initlib])
     Me.supply.Text = Trim(rs![supply])
  End If
End Sub

Private Sub comsave_Click()
  On Error Resume Next
  If Trim(stuffname) = "" Or Trim(stuffclass.Text) = "" Or Trim(unit) = "" Or Trim(initlib) = "" Or Trim(libclass.Text) = "" Then
     MsgBox "输入资料不完整!"
     Exit Sub
  End If

  Set rs = New ADODB.Recordset
  rs.Open "select * from stuffdatatable where stuffdatatable.id=" & Trim(Me.ID.Text), GetConnect, adOpenDynamic, adLockOptimistic
  If rs.EOF And rs.BOF Then
     MsgBox "ID有误!"
     rs.Close
     Exit Sub
  End If
            rs![helpcode] = Trim(Me.helpcode)
            rs![Name] = Trim(stuffname)
            rs![kind] = Trim(Me.kind)
            rs![color] = Trim(Me.color.Text)
            rs![unit] = Trim(Me.unit)
            rs![stuffclass] = Mid(stuffclass.SelectedItem.Key, 2, 100)
            rs![libclass] = Mid(libclass.SelectedItem.Key, 2, 100)
            rs![initlib] = Trim(initlib)
            rs![supply] = Trim(Me.supply.Text)
  rs.Update
  rs.Close
     Me.helpcode.Enabled = False
     Me.stuffname.Enabled = False
     Me.kind.Enabled = False
     Me.color.Enabled = False
     Me.unit.Enabled = False
     Me.stuffclass.Enabled = False
     Me.libclass.Enabled = False
     Me.initlib.Enabled = False
     Me.supply.Enabled = False
     'MsgBox "记录存盘OK!"
'''     Me.ID = ""
'''     Me.helpcode = ""
'''     Me.stuffname.Text = ""
'''     Me.kind = ""
'''     Me.color = ""
'''     Me.unit = ""
'''     Me.stuffclass.Text = ""
'''     Me.libclass.Text = ""
'''     Me.initlib = ""
'''     Me.supply = ""
End Sub

Private Sub Form_Load()
Me.Top = 1650
Me.Left = 3000
  Set rs = New ADODB.Recordset
  rs.Open "select * from libclasstable ", GetConnect, adOpenStatic, adLockReadOnly
  libclass.ComboItems.Clear
  If rs.EOF And rs.BOF Then
     MsgBox "  无资料 "
  End If
  For i = 1 To rs.RecordCount
    libclass.ComboItems.Add , "_" & rs![Name], Trim(rs![memo])
    rs.MoveNext
  Next i
  rs.Close
  
  Set rs = New ADODB.Recordset
  rs.Open "select * from stuffclasstable ", GetConnect, adOpenStatic, adLockReadOnly
  stuffclass.ComboItems.Clear
  If rs.EOF And rs.BOF Then
     MsgBox "无资料!"
  End If
  For i = 1 To rs.RecordCount
    stuffclass.ComboItems.Add , "_" & rs![ID], Trim(rs![Name])
    rs.MoveNext
  Next i
  rs.Close
  
  Set rs = New ADODB.Recordset
  rs.Open "select distinct color from stuffdatatable where color <> ''", GetConnect, adOpenStatic, adLockReadOnly
    color.Clear
  If rs.EOF And rs.BOF Then
     MsgBox "无资料!"
  End If
  For i = 1 To rs.RecordCount
    color.AddItem Trim(rs![color])
    rs.MoveNext
  Next i
  rs.Close
  
  Set rs = New ADODB.Recordset
  rs.Open "select distinct unit from stuffdatatable ", GetConnect, adOpenStatic, adLockReadOnly
    unit.Clear
  If rs.EOF And rs.BOF Then
     MsgBox "无资料!"
  End If
  For i = 1 To rs.RecordCount
    unit.AddItem Trim(rs![unit])
    rs.MoveNext
  Next i
  rs.Close
  
  Set rs = New ADODB.Recordset
  rs.Open "select distinct supply from stuffdatatable where supply <> ''", GetConnect, adOpenStatic, adLockReadOnly
  supply.Clear
  If rs.EOF And rs.BOF Then
     MsgBox "无资料!"
  End If
  For i = 1 To rs.RecordCount
    supply.AddItem Trim(rs![supply])
    rs.MoveNext
  Next i
  rs.Close
End Sub

Private Sub initlib_KeyPress(KeyAscii As Integer)
    If (KeyAscii < 45 Or KeyAscii > 57) And KeyAscii <> 47 And KeyAscii <> 8 Then
       KeyAscii = 0
    End If
End Sub


Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
  'On Error Resume Next
  Dim idstr As String   '取得当前记录号
     Select Case Button.Key
           Case "comfirst"
                Set rs = New ADODB.Recordset
                str = "SELECT stuffdatatable.id, stuffdatatable.helpcode, stuffdatatable.name, stuffdatatable.kind,stuffdatatable.color, stuffdatatable.unit, stuffclasstable.name AS stuffclass, libclasstable.memo as libclass, stuffdatatable.initlib, stuffdatatable.supply FROM stuffdatatable INNER JOIN stuffclasstable ON stuffdatatable.stuffclass = stuffclasstable.id INNER JOIN libclasstable ON stuffdatatable.libclass = libclasstable.name  order by stuffdatatable.id"
                rs.Open str, GetConnect, adOpenDynamic, adLockOptimistic
                rs.MoveFirst
                GetData
            
           Case "compro"
                If Trim(Me.ID.Text) = "" Then
                   Exit Sub
                End If
                idstr = "id=" & Trim(Me.ID.Text)
                Set rs = New ADODB.Recordset
                str = "SELECT stuffdatatable.id, stuffdatatable.helpcode, stuffdatatable.name, stuffdatatable.kind,stuffdatatable.color, stuffdatatable.unit, stuffclasstable.name AS stuffclass, libclasstable.memo as libclass, stuffdatatable.initlib, stuffdatatable.supply FROM stuffdatatable INNER JOIN stuffclasstable ON stuffdatatable.stuffclass = stuffclasstable.id INNER JOIN libclasstable ON stuffdatatable.libclass = libclasstable.name  order by stuffdatatable.id"
                rs.Open str, GetConnect, adOpenDynamic, adLockOptimistic
                If rs.EOF And rs.BOF Then
                   rs.Close
                   Exit Sub
                End If
                rs.Find idstr     '把记录定位在find 找到的记录上!
                If rs.BOF Then
                    rs.MoveFirst
                Else
                    rs.MovePrevious
                End If
                GetData
                
           Case "comnext"
                If Trim(Me.ID.Text) = "" Then
                   Exit Sub
                End If
                idstr = "id=" & Trim(Me.ID.Text)
                Set rs = New ADODB.Recordset
                str = "SELECT stuffdatatable.id, stuffdatatable.helpcode, stuffdatatable.name, stuffdatatable.kind,stuffdatatable.color, stuffdatatable.unit, stuffclasstable.name AS stuffclass, libclasstable.memo as libclass, stuffdatatable.initlib, stuffdatatable.supply FROM stuffdatatable INNER JOIN stuffclasstable ON stuffdatatable.stuffclass = stuffclasstable.id INNER JOIN libclasstable ON stuffdatatable.libclass = libclasstable.name  order by stuffdatatable.id"
                rs.Open str, GetConnect, adOpenDynamic, adLockOptimistic
                If rs.EOF And rs.BOF Then
                   rs.Close
                   Exit Sub
                End If
                rs.Find idstr
                If rs.EOF Then
                    rs.MoveLast
                Else
                    rs.MoveNext
                End If
                GetData
           
           Case "comlast"
                Set rs = New ADODB.Recordset
                str = "SELECT stuffdatatable.id, stuffdatatable.helpcode, stuffdatatable.name, stuffdatatable.kind,stuffdatatable.color, stuffdatatable.unit, stuffclasstable.name AS stuffclass, libclasstable.memo as libclass, stuffdatatable.initlib, stuffdatatable.supply FROM stuffdatatable INNER JOIN stuffclasstable ON stuffdatatable.stuffclass = stuffclasstable.id INNER JOIN libclasstable ON stuffdatatable.libclass = libclasstable.name  order by stuffdatatable.id"   'where stuffdatatable.id=" & Trim(Me.ID.Text)
                rs.Open str, GetConnect, adOpenDynamic, adLockOptimistic
                rs.MoveLast
                GetData
     End Select
 rs.Close
End Sub
Private Sub GetData()  '从数据库中取数据
If rs.EOF Or rs.BOF Then
Else
     Me.ID = Trim(rs![ID])
     Me.helpcode = Trim(rs![helpcode])
     Me.stuffname = Trim(rs![Name])
     Me.kind = Trim(rs![kind])
     Me.color.Text = Trim(rs![color])
     Me.unit = Trim(rs![unit])
     Me.stuffclass.Text = Trim(rs![stuffclass])
     Me.libclass.Text = Trim(rs![libclass])
     Me.initlib = Trim(rs![initlib])
     Me.supply.Text = Trim(rs![supply])
End If
End Sub


⌨️ 快捷键说明

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