If DCount("*", "票据临时") Mod 6 <> 0 Then
If DCount("*", "票据临时") = 0 Then
aa = 6
End If
aa = 6 - (DCount("*", "票据临时") Mod 6)
For i = 1 To aa
stDocName = "查询1"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "查询2"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Next i
End If