毕业论文论文范文课程设计实践报告法律论文英语论文教学论文医学论文农学论文艺术论文行政论文管理论文计算机安全
您现在的位置: 毕业论文 >> 课程设计 >> 正文

VB+Access仓库管理系统 第11页

更新时间:2008-1-11:  来源:毕业论文

VB+Access仓库管理系统 第11页

5.5出库界面设置

 

  与出库界面相关的代码

   Private Sub Command1_Click()

  Dim YesNo As String

   '-------------------------------判断输入----------------------------

    If Trim(Text1(0).Text) = "" Or Trim(Text1(1).Text) = "" Then  '当不要补充出库的信息时

       MsgBox ("品名与规格不能为空!")

       Text1(0).SetFocus

       Exit Sub

     End If

     If Trim(Text1(8).Text) = "" Then

       MsgBox ("请输入领料人!")

       Text1(7).SetFocus

       Exit Sub

     End If

  If IsNumeric(Text1(4)) = False Then       '判断数量是否为数值

    MsgBox ("你输入的数量有误,请输入数值!")

    Text1(4).Text = ""

    Text1(4).SetFocus

    Exit Sub

  End If

 

   '---------------------------------------------------------------------

   '-------------------------修改库存中的信息----------------------------

   stock.RecordSource = "select * from stock where 品名='" + Trim(Text1(0)) + "' and 规格='" + Trim(Text1(1)) + "'"

   stock.Refresh

   If stock.Recordset.EOF = True Then

     MsgBox ("仓库中无此物品,请采购!")

     Text1(0).SelStart = 0

     Text1(0).SelLength = Len(Text1(0).Text)

     Text1(0).SetFocus

     Exit Sub

    Else                 '存在此物,判断它的数量值

     With stock.Recordset

        If .Fields(4) < Val(Text1(4)) And .Fields(4) <> 0 Then

         

         YesNo = MsgBox("数量超出库存数量【" + Trim(Str(.Fields(4))) + "】是否全取!", vbYesNo)

           '-------------------   '根据操作来进行操作

           If YesNo = "6" Then

             temp = .Fields(4)

             .Fields(4) = 0

             .Update

              '给出库加信息

              outstorehouse.RecordSource = "outstorehouse"

              outstorehouse.Refresh

              With outstorehouse.Recordset

                .AddNew

                .Fields(0) = Text1(0)

                .Fields(1) = Text1(1)

                .Fields(2) = Text1(2)

                .Fields(3) = Text1(3)

                .Fields(4) = temp

                .Fields(5) = Text1(5)

                .Fields(6) = Date

                .Fields(7) = Text1(7)

                .Fields(8) = Text1(8)

                .Fields(9) = Text1(9)

                .Fields(10) = Text1(10)

               

              

                .Update

              End With

              Call list1disp

              Call Command2_Click

            '------------------------------

             Else

              Text1(4).SelStart = 0

              Text1(4).SelLength = Len(Text1(4))

              Text1(4).SetFocus

              Exit Sub

            End If

           '-------------------

           Else

             '--------------------

             If .Fields(4) = 0 Then

                MsgBox ("此物品已为空!")

                Text1(0).SelStart = 0

                Text1(0).SelLength = Len(Text1(0))

                Text1(0).SetFocus

                Exit Sub

               Else

                .Fields(4) = .Fields(4) - Val(Text1(4))

                .Update

                '给出库加信息

              outstorehouse.RecordSource = "outstorehouse"

              outstorehouse.Refresh

              With outstorehouse.Recordset

                .AddNew

                .Fields(0) = Text1(0)

                .Fields(1) = Text1(1)

                .Fields(2) = Text1(2)

                .Fields(3) = Text1(3)

                .Fields(4) = Text1(4)

                .Fields(5) = Text1(5)

                .Fields(6) = Text1(6)

                .Fields(7) = Text1(7)

                .Fields(8) = Text1(8)

                .Fields(9) = Text1(9)

                .Fields(10) = Text1(10)

               

                .Update

              End With

                Call list1disp

                Call Command2_Click

             End If

             '--------------------

            

        End If

     End With

   End If

   '---------------------------------------------------------------------

   '-------------------------给出库添加信息------------------------------

  

   '---------------------------------------------------------------------

End Sub

 

Private Sub Command2_Click()

  Call clearzore

  Text1(6).Text = Date

  Text1(9).Text = Operater1

  Me.Text1(0).SetFocus

End Sub

 

Private Sub Command3_Click()

  Unload Me

End Sub

 

Private Sub Form_Load()

 Me.Top = (Mainform.Height - Me.Height) / 2 - 800

 Me.Left = (Mainform.Width - Me.Width) / 2

 Me.Caption = "仓库管理系统→" & "出库操作"

 outstorehouse.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Storehouse.mdb;Persist Security Info=False"

 person.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Storehouse.mdb;Persist Security Info=False"

 stock.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Storehouse.mdb;Persist Security Info=False"

 Call clearzore

 Call list1def

 Text1(9).Text = Operater1

 Text1(6).Text = Date

 Call list1disp

End Sub

Private Sub list1def()   'list1的表头初始化

  list1.TextMatrix(0, 0) = "品名"

  list1.TextMatrix(0, 1) = "规格"

  list1.TextMatrix(0, 2) = "导电"

  list1.TextMatrix(0, 3) = "硬度"

  list1.TextMatrix(0, 4) = "数量"

  list1.TextMatrix(0, 5) = "单位"

  list1.TextMatrix(0, 6) = "出库日期"

  list1.TextMatrix(0, 7) = "领料人编码"

  list1.TextMatrix(0, 8) = "领料人"

  list1.TextMatrix(0, 9) = "经手人"

  list1.TextMatrix(0, 10) = "说明"

 

End Sub

Private Sub clearzore()  '将数据项初始化

 For i = 0 To 10

   Text1(i).Text = ""

   Text1(i).BackColor = &HFFC0C0

 Next i

End Sub

 

Private Sub Text1_GotFocus(Index As Integer)

   Text1(Index).BackColor = &HC0FFFF

End Sub

 

Private Sub Text1_LostFocus(Index As Integer)

Text1(Index).BackColor = &HFFC0C0

If Index = 7 Then

   person.RecordSource = "select * from person where 编号 = '" + Trim(Text1(7)) + "'"

   person.Refresh

   If person.Recordset.EOF Then

      MsgBox ("库中无此人,请重新输入编号!")

      Text1(7).Text = ""

      Text1(8).Text = ""

      'Text1(7).SetFocus

    Else

      Text1(8).Text = person.Recordset.Fields(1)

   End If

  End If

End Sub

Private Sub list1disp()

  Dim roww As Integer           ''

  roww = 1

  list1.Clear

  list1.rows = 1

  Call list1def

  outstorehouse.RecordSource = "select * from outstorehouse"

  outstorehouse.Refresh

  If outstorehouse.Recordset.EOF = False Then

   outstorehouse.Recordset.MoveFirst

  End If

   Do While outstorehouse.Recordset.EOF = False

        list1.rows = list1.rows + 1

    list1.TextMatrix(roww, 0) = outstorehouse.Recordset.Fields(0)

    list1.TextMatrix(roww, 1) = outstorehouse.Recordset.Fields(1)

    list1.TextMatrix(roww, 2) = outstorehouse.Recordset.Fields(2)

    list1.TextMatrix(roww, 3) = outstorehouse.Recordset.Fields(3)

    list1.TextMatrix(roww, 4) = outstorehouse.Recordset.Fields(4)

    list1.TextMatrix(roww, 5) = outstorehouse.Recordset.Fields(5)

    list1.TextMatrix(roww, 6) = outstorehouse.Recordset.Fields(6)

    list1.TextMatrix(roww, 7) = outstorehouse.Recordset.Fields(7)

    list1.TextMatrix(roww, 8) = outstorehouse.Recordset.Fields(8)

    list1.TextMatrix(roww, 9) = outstorehouse.Recordset.Fields(9)

    list1.TextMatrix(roww, 10) = outstorehouse.Recordset.Fields(10)

        roww = roww + 1

    outstorehouse.Recordset.MoveNext

  Loop

End Sub

 << 上一页  [11] [12] [13] [14] 下一页

VB+Access仓库管理系统 第11页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

copyright©751com.cn 辣文论文网 严禁转载
如果本毕业论文网损害了您的利益或者侵犯了您的权利,请及时联系,我们一定会及时改正。