| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1911 人关注过本帖
标题:求助:别人写的代码我想修改,但是不会。
只看楼主 加入收藏
gjmotboy
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2016-1-18
收藏
 问题点数:0 回复次数:0 
求助:别人写的代码我想修改,但是不会。
获取数据库数据并将数据写入 SGGRID表格,查询的结果我想对库存量进行修改,但是无法激活输入

Private Sub Get_LinkeRs()
Dim Rs As New ADODB.Recordset
Dim i As Long

Dim strsql As String

 SGGrid.rows.RemoveAll (False)
If Trim(T_WhsCode.Text) = "" Then
    frmMsgBox.Tag = "OK"
    frmMsgBox.lblTip.Caption = "查询仓库不可为空"
    'SetFormTopmost frmMsgBox
    frmMsgBox.Show vbModal
    Exit Sub

End If

strsql = "select OITW.ItemCode as 物料编码,oitm.ItemName as 物料名称,convert(nvarchar(100),oitm.U_USER41) as 规格型号,OITW.WhsCode as 仓库,OIBT.BatchNum AS 批次号,OIBT.INDATE AS 入库时间,OIBT.CARDCODE as 供应商代码, OIBT.BASEENTRY AS 单据号,OIBT.QUANTITY as 库存量 from OITW left join oitm on OITW.ItemCode=oitm.ItemCode left join OIBT on OIBT.itemcode=OITW.ItemCode and OIBT.WHSCODE=OITW.WHSCODE" _
& " where OITW.WhsCode='" & T_WhsCode.Text & "' and OITW.ItemCode like '" & T_ItemCode.Text & "%' and oitm.ItemName like '%" & T_ItemName.Text & "%'" _
& " and OIBT.QUANTITY>0"


  Rs.Open strsql, g_Cnn, adOpenForwardOnly, adLockReadOnly

 SGGrid.DataMode = sgBound

      SGGrid.CacheAllRecords = True
   Set SGGrid.DataSource = Rs


   SGGrid.AutoSizeColumns 0, SGGrid.Columns.Count - 1
        If GGS(Me, SGGrid, "") = False Then Set_Grid SGGrid

   SGGrid.row = 1
   SGGrid.TopRow = 1

SGGrid.CacheAllRecords = True
SGGrid.ColumnClickSort = True
SGGrid.AllowEdit = True
SGGrid.rows.RemoveAll (False)

SGGrid.row = 1
SGGrid.TopRow = 1

    '在网格上列加一个按钮图标
  Dim CustomDrawCol As SGColumn
   Set CustomDrawCol = SGGrid.Columns(1)
   CustomDrawCol.Control.ShowButton = sgShowButtonFocused
  
End Sub
搜索更多相关主题的帖子: 数据库数据 convert 库存量 False 仓库 
2016-01-18 16:16
快速回复:求助:别人写的代码我想修改,但是不会。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026278 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved