Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I would like my Year and Month list boxes to auto select current year and month when users access the model. How can I do this?
check the 2nd half of my post, you can use the Today() function to grab today's date, and the pull the year and month from that
Year(Today())
Month(Today()) or if your most recent month is behind today's month, Max( {$<Year={$(=Year(Today()))} Month)
hi goto document properties> on open sheet> add triger > add action > max(year)&max(month)
I think you want it on the 'open document' trigger and use two 'select in field' actions with the above expressions for the respective fields .
For max month, grab the max month for the max(year) through SET ANALYSIS because even though you have full years, you may be partially through the year at say November and you want November, not December. Here is a sample expression for select in field on the month field.
Max( {$<Year={$(=Max(Year))}>} Month)
you can also use Year(Today()) and Month(Today()) to get back today's year and month, but your app may not have data for today year and month so max() is usually more safe
Thanks for your suggestion guys!
One thing though, I have years in the future as the field I am using for years has years like 2015,2016,2017.
So Max will default to 2017 and I want it to default to the current year.
check the 2nd half of my post, you can use the Today() function to grab today's date, and the pull the year and month from that
Year(Today())
Month(Today()) or if your most recent month is behind today's month, Max( {$<Year={$(=Year(Today()))} Month)
this expression is what i was looking for as it would avoid multiple Triggers for the QV document.
Thanks
Jonathan
Good to hear. Worth marking correct / helpful posts so that others with future dates in their model can find the correct solution.