求助:别人写的代码我想修改,但是不会。
获取数据库数据并将数据写入 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