|
本帖最后由 shitou1ge 于 2009-4-7 15:34 编辑
图片中zzz 为主机 zzz=zzz\001+zzz\003+zzz\11+zzz\12 可是我的总是没有数字显示 倒底是咋回事 小妹请大家帮忙
Private Sub 主机统计()
Dim jilu As Long, i As Long, j As Long, BBB As String
Dim AAA As Long, sum
DoCmd.OpenForm "定额明细总表1", , , , , acHidden
Forms!定额明细总表1.Requery
jilu = DCount("cpbm", "汇总表")
For i = 1 To jilu
If IsNull(Forms!定额明细总表1!CPLX) Then
Else
If Forms!定额明细总表1!CPLX = "主机" Then
AAA = Forms!定额明细总表1!编号
BBB = Forms!定额明细总表1!CPBM
sum = 0
DoCmd.GoToRecord , "定额明细总表1", acFirst
For j = 1 To jilu
If (Forms!定额明细总表1!CPLX = "组件" Or Forms!定额明细总表1!CPLX = "零件") Then
If Forms!定额明细总表1!CPBM Like BBB & "*" And Len(Forms!定额明细总表1!CPBM) < 8 Then
sum = sum + Forms!定额明细总表1!CLGYZJE
End If
End If
DoCmd.GoToRecord acDataForm, "定额明细总表1", acNext
Next
DoCmd.GoToRecord acDataForm, "定额明细总表1", acGoTo, AAA
Forms!定额明细总表1!CLGYZJE = sum
End If
End If
DoCmd.GoToRecord acDataForm, "定额明细总表1", acNext
Next
DoCmd.Close acForm, "定额明细总表1"
End Sub |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|