商品销售管理系统 第8页

商品销售管理系统 第8页

End Sub

 

 '更新某个字段

Private Sub DataGrid1_SelChange(Cancel As Integer)

On Error Resume Next

  Adodc1.Recordset.Fields("剩余数量").Value = Adodc1.Recordset.Fields("库存数量").Value - xskd_frm.DataGrid1.Columns(7).Value

  xskd_frm.Adodc1.Recordset.MoveNext

 

End Sub

 

Private Sub find_cmd_Click()

  '按字段查找

If Combo2.Text = "like" Then

   Adodc1.RecordSource = "select * from 商品信息表 where " & Combo1.Text & " " & Combo2.Text & "' % " & Text1.Text & " % '"

   Adodc1.Refresh

Else

   Adodc1.RecordSource = "select * from 商品信息表 where " & Combo1.Text & " " & Combo2.Text & "'" & Text1.Text & " '"

   Adodc1.Refresh

End If

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

 

End Sub

 

Private Sub Form_Load()

cbooperators Combo2   '调用查询操作符

Combo2.ListIndex = 0

Call cnn

rs1.Open "select * from 商品信息表 ", cn, adOpenKeyset, adLockOptimistic

rs2.Open "select * from 销售信息表 ", cn, adOpenKeyset, adLockOptimistic

Dim fld

 For Each fld In rs1.Fields   '添加字段

 Combo1.AddItem fld.Name

Next fld

rs1.Close

Combo1.ListIndex = 0

DataGrid1.MarqueeStyle = dbgDottedCellBorder

 '在状态栏上显示记录数和当前的第几条

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

St1.Panels(1).Width = 3600

St1.Panels.Add

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

St1.Panels(2).Width = 600

St1.Panels.Add

St1.Panels(3).Text = ""

St1.Panels(3).Width = 600

rs2.Close

cn.Close 

End Sub

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

  • 上一篇文章:
  • 下一篇文章:
  • Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有