Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

One Listbox, Two Fields

Hello.

I have a couple of listboxes (year, month, day, ...) that I would like to use in order to filter two different (and unrelated) date fields in two different (and unrelated) tables.

Is there a way to do this in QV10?

Ah... and I can't have an expression like "TableAYear & TableBYear" in the Field of the Listbox :s

Example:

Table A:

IdA DateA

1 2009-06-01

2 2011-06-05

3 2012-06-15

Table B:

IdB DateB

1 2010-07-12

2 2011-08-01

3 2012-09-29

Having a listbox named "Year" with the values of the two tables (2009, 2010, 2011, 2012), I want to select 2011 and QV automatically select the values in table A and/or in table B.

Thanks in advance

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

For this purpose use triggers Which is under document properties.

Set a trigger on change for the field either Table A or Table B fields and then set the values using get current selections for the Select in field action.

View solution in original post

4 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

For this purpose use triggers Which is under document properties.

Set a trigger on change for the field either Table A or Table B fields and then set the values using get current selections for the Select in field action.

Not applicable
Author

If I have the listbox referencing DateA what would be my parameters in the "Select In Field"?

Cause I've had set an action in the sheet properties:

Actions: Select in Field

Field: DateB

Search String: =GetCurrentSelections(DateA)

And even when I select a value in the listbox, DateB doesn't get selected =/

What am I doing wrong?

Thanks

Not applicable
Author

Thanks Celambarasan I was able to do what I wanted with that method

I had mistakenly set the action in the Sheet Properties and couldn't find the "On Change" event.

In fact what I needed is exactly that in the Document Properties

Not applicable
Author

After my initial problem was resolved, i am now facing another problem which is quite tricky (remember user selects fields "A" and fields "B" must have the same value but are "hidden").

Example:

YearA has:

2009, 2010, 2011

YearB has:

2009, 2010, 2011

So far, so good there the same years in both fields but from now on it gets bad...

MonthA has:

January, February, March, April

MonthB has:

January, March, July, September

So, when I select the year 2010 in the "YearA" listbox, "YearB" gets the same value after the trigger implementation but it also gets July in the field "MonthB" since it's the only month with values for that year.

If I select February afterwards in MonthA listbox, and with the trigger implemented, I would expected QV to "know" that MonthB has no "February" value so it would get Null but no... It remains with the July selection on even after the trigger "Select in Field" fires... :s

How can I fix this in QV10?