Create a function with a constrained list of arguments

?

-

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)
 
S

Scott McDaniel

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 ... "
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top