PDA

View Full Version : Drop Down to Filter child browse


ABC123

Gustavo1478
10-30-2014, 05:35 PM
On the Desktop version inside a form using dbf tables, Im trying to create a drop down menu that populates unique values from field in a child table that when selected will filter a child browse in a form to whatever has been selected.
The field that im using holds a simple four digit year, 2010, 2011, 2012 etc. based dynamically on the table values. I was able to get my session variable to populate a unique list but when I select an item the browse does not filter or it filters only one year (which was not the year selected). Additionaly i would like to add an option to the list that states "ALL" so that I can release the filter to show all years.

Ive attached a sample.

Thank you in advance for any help.
-Ivan

Ray in Capetown
11-03-2014, 11:10 AM
On the Desktop version inside a form using dbf tables, Im trying to create a drop down menu that populates unique values from field in a child table that when selected will filter a child browse in a form to whatever has been selected.
The field that im using holds a simple four digit year, 2010, 2011, 2012 etc. based dynamically on the table values. I was able to get my session variable to populate a unique list but when I select an item the browse does not filter or it filters only one year (which was not the year selected). Additionaly i would like to add an option to the list that states "ALL" so that I can release the filter to show all years.

Ive attached a sample.

Thank you in advance for any help.
-Ivan

Ivan
topparent.QuickSrchExplicit("Action") cant work for all of the below
1. there is no child table, just a browse on the form's table
2. You are attempting to use Quicksearch based on a form field external to the browse,- quicksearch applies to a field value in the same browse
3. The YEAR field in the table is Char 4, the form field "action" you want to filter on is numeric

I recon you might want to start with some basic tutorials. Follow the help...

Filtering a Browse with a Combo Box Selection

This topic refers to the AlphaSports sample database provided with Alpha Five.

Gustavo1478
11-03-2014, 05:29 PM
Sorry about that, I forgot to leave in the parent table and its set. I was trying to create a drop down menu that would filter the browse based on its own unique values using the YEAR field.

I do see now that the variable was set as numeric. Let me toy with this a bit more, Im still learning Alpha. Thanks for the help.

Gustavo1478
11-03-2014, 06:11 PM
Ive attached a new copy of what Im working with, Since you had said that the topparent.QuickSrchExplicit() would not work here, what would be the correct function?

I took a look at the "Filtering a Browse with a Combo Box Selection" and it had some very useful information but I still wasnt able to accomplish what Im trying to do here.

39103

MoGrace
11-03-2014, 09:23 PM
Hi Ivan,
If you reverse this set, your task will be easier. Then you can have 2 combo boxes: First select the staff member then in the 2nd select the start year.

Your form can still look the same, but you may need to set the OnInit event so the form opens to show records in the browse for only the first Staff ID. (I didn't add that yet)

I'll try to make you an example...

Edit: I added 2 character fields to use in place of your numeric ID STAFF_ID fields. It is easier to work with queries when you don't have to convert your field data to strings - IMHO.