|
3#
楼主 |
发表于 2003-9-24 06:35:00
|
只看该作者
出现问题的代码为:
Sub LEFT()
Dim CNN1 As New ADODB.Connection
Dim RS1 As New ADODB.Recordset, RS2 As New ADODB.Recordset
Dim SQLSTR As String, SQLSTR1 As String
SQLSTR = "select Sum([FVBAOrderDetails].[VEXQTY]) AS [EXQTY之Sum], Sum([FVBAOrderDetails].[CT]) AS [CT之Sum] FROM [FVBAOrderDetails] where ODeatilID=" & Me.ID & ""
SQLSTR1 = "select finish,course from [order details] where id=" & Me.ID & ""
Set CNN1 = CurrentProject.Connection
RS1.Open SQLSTR, CNN1, adOpenKeyset, adLockPessimistic
RS2.Open SQLSTR1, CNN1, adOpenKeyset, adLockPessimistic
If RS1.RecordCount > 0 Then
Me.Parent![剩余数量] = Me.ODRQTY - Nz(RS1.Fields(0), 0)
Me.Parent![累计出货数] = Nz(RS1.Fields(0), 0)
Me.Parent![CT] = Me.CT - Nz(RS1.Fields(1), 0)
If Me.ODRQTY - Nz(RS1.Fields(0), 0) = 0 Then
Me.Finish = 1
Me.Course = 0
ElseIf Nz(RS1.Fields(0)) > 0 Then
Me.Finish = 0
Me.Course = 1
Else
Me.Finish = 0
Me.Course = 0
End If
Exit Sub
End If
Me.Parent![剩余数量] = Me.ODRQTY
Set RS1 = Nothing
End Sub |
|