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

商品销售管理系统 第7页

更新时间:2008-3-29:  来源:毕业论文

商品销售管理系统 第7页

Public rs2 As New ADODB.Recordset

Private Sub Command2_Click(Index As Integer)

Select Case Index

    Case 0

       '添加记录

      Adodc1.RecordSource = "select * from 商品信息表 order by 商品编号"

            a = MsgBox("是否进行添加", vbOKCancel + vbInformation)

            If a = vbOK Then

            DataGrid1.AllowAddNew = True

            DataGrid1.AllowUpdate = True

            End If

          Command2(0).Enabled = False

          Command2(1).Enabled = True

          Command2(2).Enabled = False

          Command2(3).Enabled = True

          Command2(4).Enabled = True

          Command2(5).Enabled = True

          find_cmd.Enabled = False

          Combo1.Enabled = False

          Combo2.Enabled = False

         

    Case 1

      '修改记录

        Adodc1.RecordSource = "select * from 商品信息表 order by 商品编号"

            b = MsgBox("是否进行修改", vbOKCancel + vbInformation)

            If b = vbOK Then

            DataGrid1.AllowUpdate = True

            End If

          Command2(0).Enabled = True

          Command2(1).Enabled = False

          Command2(2).Enabled = False

          Command2(3).Enabled = True

          Command2(4).Enabled = True

          Command2(5).Enabled = True

          find_cmd.Enabled = True

          Combo1.Enabled = True

          Combo2.Enabled = True

       

    Case 2

          '删除记录

       Adodc1.RecordSource = "select * from 商品信息表 order by 商品编号"

            c = MsgBox("是否进行删除", vbOKCancel + vbInformation)

            If c = vbOK Then

              Dim varbmk As Variant

             For Each varbmk In DataGrid1.SelBookmarks

               Adodc1.Recordset.Bookmark = varbmk

               Adodc1.Recordset.Delete

               Adodc1.Recordset.UpdateBatch

             Next

            End If

          Command2(0).Enabled = True

          Command2(1).Enabled = False

          Command2(2).Enabled = False

          Command2(3).Enabled = True

          Command2(4).Enabled = True

          Command2(5).Enabled = True

          find_cmd.Enabled = True

          Combo1.Enabled = True

          Combo2.Enabled = True

      

    Case 3

         '保存记录

       Adodc1.RecordSource = "select * from 商品信息表 order by 商品编号"

            d = MsgBox("是否进行保存", vbOKCancel + vbInformation)

            If d = vbOK Then

            DataGrid1.AllowUpdate = True

            End If

          St1.Panels(1).Text = "记录数:   " & DataGrid1.ApproxCount & "  " & "" & "      " & "当前记录为:"

          Command2(2).Enabled = True

          Command2(3).Enabled = False

          Command2(4).Enabled = False

          find_cmd.Enabled = False

          Combo1.Enabled = False

          Combo2.Enabled = False

       

    Case 4

      '取消记录

      Adodc1.RecordSource = "select * from 商品信息表 order by 商品编号"

            e = MsgBox("是否进行取消", vbOKCancel + vbInformation)

            If e = vbOK Then

            Adodc1.Recordset.CancelBatch

            Adodc1.Recordset.CancelUpdate

            End If

            Command2(0).Enabled = True

            Command2(1).Enabled = True

            Command2(2).Enabled = True

           Command2(3).Enabled = False

           Command2(4).Enabled = False

           find_cmd.Enabled = False

           Combo1.Enabled = False

           Combo2.Enabled = False

    

   Case 5

     '退出

     Call cmdend(Me)

    

End Select

 

End Sub

 

'以回车键辅助输入数据

Private Sub DataGrid1_KeyUp(KeyCode As Integer, Shift As Integer)

If KeyCode = 13 Then

 If DataGrid1.Col < 8 Then

  DataGrid1.Col = DataGrid1.Col + 1

  DataGrid1.Scroll 1, 1

 Else

   If DataGrid1.Row > DataGrid1.Row - 1 Then

   On Error Resume Next

    DataGrid1.Row = DataGrid1.Row + 1

    DataGrid1.Scroll DataGrid1.VisibleCols - 9, DataGrid1.Row + 1

    DataGrid1.Col = 0

   End If

  End If

End If

 

End Sub

 

  '更新记录

Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)

 Label1.Caption = DataGrid1.Row

  St1.Panels(2).Text = Label1.Caption

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

商品销售管理系统 第7页下载如图片无法显示或论文不完整,请联系qq752018766
设为首页 | 联系站长 | 友情链接 | 网站地图 |

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