第一次发帖,实在做不下去了,求帮助~VB6.0-K3二次开发
今天小弟第一次用VB6.0开发。要新做个功能在一张单据的单据体中,有3列,物料,供应商,原价。需求:‘原价’根据‘物料’与‘供应商’填最新值(即日期最大)
Private cnConn As New ADODB.Connection
Private res As New ADODB.Recordset
Private suppler As String
Private item As String
Private Sub m_BillTransfer_GridChange(ByVal Col As Long, ByVal Row As Long, ByVal Value As Variant, ByVal bNewBill As Boolean, Cancel As Boolean)
Dim FItemID As Long '物料内码
Dim FBase3 As String '物料代码
Dim FSupplyID As String '供应商代码
If Col = 3 Then '物料
item = m_BillTransfer.GetGridText(Row, Col)
End If
If Col = 8 Then '供应商
suppler = m_BillTransfer.GetGridText(Row, Col)
End If
If suppler <> "" And item <> "" Then
cnConn.ConnectionString = m_BillTransfer.Cnnstring
cnConn.Open
res.Open "Select PO.FItemID,P.FSupplyID,MAX(PO.FDate) AS DATE,PO.FAuxTaxPrice from POorder P left outer join POorderEntry po on po.FInterID = p.FInterID Where P.FStatus = 1 AND po.FItemID = " & CStr(item) And P.FSupplyID = " & CStr(suppler) Group by PO.FItemID,P.FSupplyID,PO.FAuxTaxPrice", cnConn, adOpenDynamic, adLockOptimistic
’---求帮助取金额----PO.FAuxTaxPrice --------------------------
m_BillTransfer.SetGridText Row, 10, ***
End If
End Sub --------------------编程问答--------------------
res.Open "Select PO.FItemID,P.FSupplyID,MAX(PO.FDate) AS DATE,PO.FAuxTaxPrice from POorder P left outer join POorderEntry po on po.FInterID = p.FInterID Where P.FStatus = 1 AND po.FItemID = '" & CStr(item) & "' And P.FSupplyID = '" & CStr(suppler) & "' Group by PO.FItemID,P.FSupplyID,PO.FAuxTaxPrice", cnConn, adOpenDynamic, adLockOptimistic
补充:VB , COM/DCOM/COM+