Access中VBA编程问题,求详解

2024-12-29 08:01:37
推荐回答(1个)
回答1:

'此函数作用是执行递加操作,如N=5,则函数结果是=1+2+3+4+5=15
Public Function P(N As Integer)
Dim Sum As Integer
Sum=0
For i=1 To N
Sum=Sum+i
Next i
P=Sum
End Function
所以S=P(1)+P(2)+P(3)+P(4)=1+3+6+10=20