문제

Private Sub a()
   b 1,
End Sub

Private Sub b(p1 As Variant, Optional p2 As Variant)
   Stop
End Sub

I am Using VBA in Access. I want to have a Procedure with 2 parameters - the last 1 being optional. Why won't Private Sub a() compile.

How do I run a() with a call to b() and pass no parameter as the second argument?

도움이 되었습니까?

해결책

The trailing , breaks the syntax rules, omit it:

b 1

(Or provide a placeholder b 1, p2:)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top