- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Select certain year in the list box by using variable
Hi all,
I have this list box where I store data about years:
year
2015/6
2014/5
2013/2
2012/1
I would like the year 2014/5 to be pre-selected for users when they open the application. I have been trying this with some variables, but unfortunately not very successfully.
Do you have any advice how to do this?
Thank you for your advice in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
try to use a trigger at the document level (Settings --> Document Properties --> Triggers) on the OnOpen event and add a Select in Field Action on Year field (search string 2014/5)
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tereza
Do test this early in WebView / AccessPoint Ajax mode as I fear they do not support OnOpen Triggers, even though they work perfectly in the standard Qv Desktop.
Best Regards, Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Go to any sheet and right click
Properties
Triggers
OnActiveSheet
AddAction
Add
Selection
Select in Field
Field = Year
SearchString = 2014/5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the advice guys, but it does not work for me. Also at the moment I want the year 2014/5 be pre-selected, but in some point in the future I would like 2015/16 selected etc. So with the roll-over to another year the SearchString would have to be changed, which in my opinion is not the best practice.
I am thinking about having a variable set in my load script, where max(year)-365. Any thoughts on this approach?
Cheers T.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi TerezaGr,
I'm not sure if this is helpful in your case but I use a document trigger to select a date range.
Settings --> Document Properties --> Triggers --> Document Event triggers --> OnOpen --> Add --> Select in Field...
Field: Date
Search String: ='>=' & weekstart(today(0)) & '<=' & weekend(today(0)+200)
Perhaps it is helpful and you can use it in your scenario.
It works in QV Desktop and Ajax (QV AccessPoint).as well.
Best Regards and I hope its helpful,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for info Bill, I tested it and in Ajax OnOpen doesn't work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi evrybody
to use a variable, it is not SELECT in field but "External", "set variable"
best regards
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Chris,
in general you are right.
I don't know exactly what T. wants to do, but perhaps it is not neccessary to use a variable. Or the variable can be set during script run and than used in the search expression of the trigger event.
By the way, I didn't saw that maxgro already described what I suggested.