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

📄 chuku.frm

📁 这是本人利用vb+access 开发的一个二库存进销存系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Left            =   240
         TabIndex        =   2
         Top             =   360
         Width           =   975
      End
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Bindings        =   "chuku.frx":0000
      Height          =   5775
      Left            =   120
      TabIndex        =   31
      Top             =   840
      Width           =   6375
      _ExtentX        =   11245
      _ExtentY        =   10186
      _Version        =   393216
      FixedCols       =   0
      BackColor       =   16776960
      BackColorSel    =   8421440
      ForeColorSel    =   8454143
      FocusRect       =   2
      SelectionMode   =   1
      AllowUserResizing=   3
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Caption         =   "出 库 单 列 表"
      BeginProperty Font 
         Name            =   "黑体"
         Size            =   24
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   495
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   6375
   End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public rec As Integer
Dim bz1 As Integer
Dim yje As Single
Dim ysl As Single
Dim byj As Single
Dim rky As Single

Private Sub Combo1_Click()
Combo2.Clear
If Data2.Recordset.RecordCount > 0 Then
   Data2.Recordset.MoveFirst
End If
While Data2.Recordset.EOF = False
  If Data2.Recordset.Fields("品牌") = Combo1.Text Then
    Combo2.AddItem Data2.Recordset.Fields("产品")
  End If
  Data2.Recordset.MoveNext
Wend
Combo2.Text = Combo2.List(0)
End Sub
Private Sub Combo1_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

Private Sub Combo2_Click()
Combo3.Clear
If Data2.Recordset.RecordCount > 0 Then
   Data2.Recordset.MoveFirst
End If
While Data2.Recordset.EOF = False
  If Data2.Recordset.Fields("产品") = Combo2.Text Then
    Combo3.AddItem Data2.Recordset.Fields("规格")
  End If
  Data2.Recordset.MoveNext
Wend
Combo3.Text = Combo3.List(0)
Combo3.Enabled = False
Combo4.Clear
If Data2.Recordset.RecordCount > 0 Then
   Data2.Recordset.MoveFirst
End If
While Data2.Recordset.EOF = False
  If Data2.Recordset.Fields("规格") = Combo3.Text Then
    Combo4.AddItem Data2.Recordset.Fields("单位")
  End If
  Data2.Recordset.MoveNext
Wend
Combo4.Text = Combo4.List(0)
Combo4.Enabled = False
End Sub
Private Sub Combo2_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

Private Sub Combo3_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub
Private Sub Combo4_KeyPress(KeyAscii As Integer)
KeyAscii = 0
End Sub

Private Sub Command1_Click()
Frame1.Enabled = True
Command2.Enabled = True
Text5.Text = ""
bz1 = 1
Text5.SetFocus

End Sub

Private Sub Command2_Click()
If Combo1.Text = "" Or Combo2.Text = "" Or Combo3.Text = "" Or Combo4.Text = "" Or Text4.Text = "" Or Text5.Text = "" Then
  MsgBox "数据不合法"
  Exit Sub
End If

  Data2.Recordset.FindFirst "规格=" + "'" + Combo3.Text + "'"
  If Data2.Recordset.NoMatch = True Then
  Else
  If Data2.Recordset.Fields("数量") < Val(Text4.Text) Then
  MsgBox "库存不足,无法出库!", 0 + 16, "警告"
  Exit Sub
  
  Else
  Data2.Recordset.Edit
  Data2.Recordset.Fields("数量") = Data2.Recordset.Fields("数量") - Val(Text4.Text)
  Data2.Recordset.Update
  End If
  End If

If bz1 = 1 Then
  Data3.Recordset.FindFirst "产品+品牌+规格+单位=" + "'" + Combo2.Text + Combo1.Text + Combo3.Text + Combo4.Text + "'"
With Data3.Recordset
  .AddNew
  .Update
  .Bookmark = .LastModified
  .Edit
  .Fields("产品") = Combo2.Text
  .Fields("品牌") = Combo1.Text
  .Fields("规格") = Combo3.Text
  .Fields("单位") = Combo4.Text
  .Fields("数量") = Text4.Text
  .Fields("编号") = Text5.Text
  .Fields("备注") = Text6.Text
  If Val(Text2.Text) < 10 Then
    If Val(Text3.Text) < 10 Then
    .Fields("时间") = Text1.Text + "0" + Text2.Text + "0" + Text3.Text
    Else
    .Fields("时间") = Text1.Text + "0" + Text2.Text + Text3.Text
    End If
    Else
    If Val(Text3.Text) < 10 Then
    .Fields("时间") = Text1.Text + Text2.Text + "0" + Text3.Text
    Else
    .Fields("时间") = Text1.Text + Text2.Text + Text3.Text
    End If
  End If
  .Update
End With
End If

 Data3.Refresh
 Command2.Enabled = False
 Command5.Enabled = False
 Text4.Text = ""
 Text5.Text = ""
 Text6.Text = ""
 Frame1.Enabled = False
 Command1.Enabled = True
 Command1.SetFocus
End Sub

Private Sub Command3_Click()
End Sub

Private Sub Command5_Click()
Dim msg As Long
Dim sl As Single
Dim gg As String
msg = MsgBox("是否确认删除?", 1 + 32)
If msg = 1 Then
    
   Data3.Recordset.AbsolutePosition = rec
     If Data3.Recordset.Fields(0) <> "" Then
     gg = Data3.Recordset.Fields("规格")
     sl = Data3.Recordset.Fields("数量")
      Data3.Recordset.Delete
      Data3.Recordset.MoveNext
  End If
   If Data3.Recordset.EOF = True Then
    Data3.Recordset.MovePrevious
   End If
   Data2.Recordset.FindFirst "规格=" + "'" + gg + "'"
  If Data2.Recordset.NoMatch = True Then
  Else
  Data2.Recordset.Edit
  Data2.Recordset.Fields("数量") = Data2.Recordset.Fields("数量") + sl
  Data2.Recordset.Update
  End If
  
 End If
Data3.Refresh
Command5.Enabled = False
If Data3.Recordset.RecordCount > 0 Then
MSFlexGrid1.Row = 1
End If
End Sub

Private Sub Command6_Click()
Unload Me
End Sub
Private Sub Data3_Reposition()
 If Data3.Recordset.RecordCount > 0 Then
    MSFlexGrid1.Enabled = True
    Else
    MSFlexGrid1.Enabled = False
  End If
End Sub

Private Sub Form_Activate()

Data1.DatabaseName = App.Path + "\odb.dll"
Data1.RecordSource = "paizi"
Data1.Refresh
Data2.DatabaseName = App.Path + "\odb.dll"
Data2.RecordSource = "kucun"
Data2.Refresh
Data3.DatabaseName = App.Path + "\odb.dll"
Data3.RecordSource = "chuku"
Data3.Refresh
If Data1.Recordset.RecordCount > 0 Then
   Data1.Recordset.MoveFirst
End If
While Data1.Recordset.EOF = False
  Combo1.AddItem Data1.Recordset.Fields("品牌")
  Data1.Recordset.MoveNext
Wend
Combo1.Text = Combo1.List(0)
If Data2.Recordset.RecordCount > 0 Then
   Data2.Recordset.MoveFirst
End If
While Data2.Recordset.EOF = False
  If Data2.Recordset.Fields("品牌") = Combo1.Text Then
     Combo2.AddItem Data2.Recordset.Fields("产品")
  End If
  Data2.Recordset.MoveNext
Wend
Combo2.Text = Combo2.List(0)

If Data2.Recordset.RecordCount > 0 Then
   Data2.Recordset.MoveFirst
End If
While Data2.Recordset.EOF = False
  If Data2.Recordset.Fields("产品") = Combo2.Text Then
    Combo3.AddItem Data2.Recordset.Fields("规格")
  End If
   Data2.Recordset.MoveNext
Wend
Combo3.Text = Combo3.List(0)

While Data2.Recordset.EOF = False
  If Data2.Recordset.Fields("规格") = Combo3.Text Then
    Combo4.AddItem Data2.Recordset.Fields("单位")
  End If
   Data2.Recordset.MoveNext
Wend
Combo4.Text = Combo4.List(0)

Text1.Text = Year(Now)
Text2.Text = Month(Now)
Text3.Text = Day(Now)
VScroll1.Value = Text1.Text
VScroll2.Value = Text2.Text
VScroll3.Value = Text3.Text

Command2.Enabled = False
Command5.Enabled = False
Frame1.Enabled = False
End Sub

Private Sub MSFlexGrid1_Click()
rec = MSFlexGrid1.Row - 1
Command5.Enabled = True
End Sub


Private Sub Text4_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
  Text5.SetFocus
End If
End Sub

Private Sub Text5_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
  Text6.SetFocus
End If
End Sub

Private Sub Text6_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
  Command2.SetFocus
End If
End Sub
Private Sub VScroll1_Change()
Text1.Text = VScroll1.Value
End Sub

Private Sub VScroll2_Change()
Text2.Text = VScroll2.Value
End Sub

Private Sub VScroll3_Change()
Text3.Text = VScroll3.Value
End Sub

⌨️ 快捷键说明

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