var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: VBA : Predefine parameters for a sub
I have following question.
When using a default sub or function, access sometimes presents the possible values of the parameters which will be passed.
for example : As soon as I write 'Weekday(' --> access shows me that I have to fill in 'Date' and 'FirstDayOfWeek'
When I get to the 'FirstDayOfWeek'parameter it even shows me a list of possible values (vbMonday, vbTuesday, ....)
How can I write a sub or function and also present the possible values to the guy who is using the sub?
Hope my explanation is clear.
Check out Enums in the VBA help.
Tried using Enums and is working OK.
But I'm still wondering if how I could get the list of predefined days (like vbMonday, vbTuesday, ...)
I can create an enum again with these days, but it seems a bit silly because it already exists one way or another.
You need to start looking in the object browser. I'll talk you through this one
So - how do you use it? Just like your own enum. Open VBA IDE Hit F2 Change the upper of the two combo boxes to VBA (just filters things) Scroll down the classes Notice that the bottom classes have a yellow icon - two boxes next to each other, one raised? That's the enum icon. Click on VbDayOfWeek Ta da!
Sum EnumExample (MyInput AS VbDayOfWeek)