Create a function with a constrained list of arguments

  • Thread starter Thread starter -
  • Start date Start date
?

-

Hi there. I'm creating a function and would like the second argument to
only accept a finite set of predefined choices, so that when I go to
consume the function a dropdown of the pre-defined options pops up to
aid the selection.


I vaguely recall reading about it a while back but can't for the life
of me remember how it was done, or even what keywords to perform a
search with. Hence this post.

A thousand thanks to s/he who responds.

(BTW -my reply email add' is bogus)
 
You can base your second argurment on an Enum:

[In a standard Public Module]
Public Enum Colors
Red =1
Yellow =2
Green =3
End Enum

[your function]
Function ChangeColors(CarID As Long, ColorID As Colors)

<your nifty code here>

End function
--
Scott McDaniel
CS Computer Software
Visual Basic - Access - Sql Server - ASP

"Smash forehead on keyboard to continue ... "
 
Back
Top