質問

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