老师您好!
我想用ddqdb中的数据回填到ddpsb中,我的回填程序是运行成功的。我想编写代码显示哪些数据是回填上去的。怎么写代码?谢谢!我的源代码是这样的:
Dim zh1 As String 'ddqdb的zzh
Dim zh2 As String 'ddpsb的zzh
Dim zl As Double
Dim je As Double
Dim bje As Double
Dim ts As Integer
Dim zyy As String
Dim zyy1 As String
Dim zyy2 As String
Dim lg As Integer
Dim dzl As Double
Dim dje As Double
Dim dbje As Double
Dim count As Integer
Dim wr As DataRow
Dim wzl As Double
For Each dr As DataRow In DataTables("ddqdb").DataRows
zh1=dr("zzh")
zl = Tables("ddqdb").Compute("Sum(重量)","[zzh]='" & zh1 & "'" )
dr = DataTables("ddqdb").Find("[zzh]='" & zh1 & "'" )
If dr("客户")="魏德曼"
wzl = Tables("ddqdb").Compute("Sum(理论重量)","[zzh]='" & zh1 & "'" )
wzl=Round2(wzl,2)
dje=dr("含税价")*wzl
je=dje
Else
je = Tables("ddqdb").Compute("Sum(含税金额)","[zzh]='" & zh1 & "'" )
bje = Tables("ddqdb").Compute("Sum(不开piao金额)","[zzh]='" & zh1 & "'" )
End If
If dr IsNot Nothing Then
ts=dr("台数")
dzl=zl/ts
If dr("客户")<>"魏德曼"
dje=je/ts
End If
dbje=bje/ts
If dr.isnull("zzh_yy") = False
zyy=dr("zzh_yy")
If zyy.length >= 2
zyy1=zyy.SubString(0,2)
End If
If zyy.length >= 5
zyy2=zyy.SubString(3,2)
End If
Dim k1 As Integer
Dim k2 As Integer
k1=cint(zyy1)
k2=cint(zyy2)
Dim i As Integer
Dim zys(10) As String
For i=k1 To k2
If ts<=9
zys(i)="0"+cstr(i)
Else
zys(i)=cstr(i)
End If
wr=DataTables("ddpsb").find("[zzh]='" & zh1 & "'and [zzh_xx]='" & zys(i) & "' and 净重 is null")
If wr IsNot Nothing Then
If dzl<>0
wr("净重")=dzl
wr("含税金额")=dje
wr("不开piao金额")=dbje
End If
End If
Next
Else
wr=DataTables("ddpsb").find("[zzh]='" & zh1 & "'and 净重 is null")
If wr IsNot Nothing Then
If zl <>0
wr("净重")=zl
wr("含税金额")=je
wr("不开piao金额")=bje
End If
End If
End If
End If
Next
messagebox.show("回填完毕")