Pregunta

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?

¿Fue útil?

Solución

The trailing , breaks the syntax rules, omit it:

b 1

(Or provide a placeholder b 1, p2:)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top