Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a listbox containing "CalendarDate". I want to add a button that uses a macro that allows the user to select a date in the listbox, and then click the button to also select the 11 prior dates in the listbox. So, if the user selects "5/1/2016", and then clicks the button, the 11 preceding dates in the listbox will also be selected.
How do I accomplish this?
Hey John,
Are those date consecutive? Or there may be some gaps (missing dates) in the listbox?
BR,
Kuba
They're assumed to be consecutive (each date represents the 1st day of each month). The list is sorted in descending order with the most recent date being displayed first.
Hello John,
Please see attached app.
Considering the field is named "Date", I have created a button and added "Select in Field" Action into it:
Field:
Date
Expression:
='>'&Date([Date]-12)&'<='&Date([Date])
PS Button is active only if 1 value is selected in Date listbox.
BR,
Kuba
I had to make a change, given that the dates are always the first of the month, but in general, it worked:
='>'&AddMonths(Date([CalendarDate]),-11)&'<='&Date([CalendarDate])
Many thanks.
Hey John,
Glad it worked for you! Please mark question as answered.
BR,
Kuba