Dependent option groups within a form

inq80

Registered User.
Local time
Today, 07:41
Joined
Nov 14, 2015
Messages
39
Hi,

Can someone point me to the right direction?

I've created a form with three option groups on it.

I need to restrict the options available in the third group depending on what answers the user chose in the previous two groups.

I assume this will need to refer to a table with the details within but do not know how to do it.

Anyone any ideas or pointers on how i can achieve this?

Thanks
 

Attachments

in the frame 19 after update event you will need some code to show or hide the relevent options in option group 3. Something like

Code:
 select case frame10
     case 1
         select case frame 19
             case 1
                  toggle30.visible =false
                  toggle21.visible=true
         end select
     case 2  
         select case frame 19
              case 1
             ...
             ...
         end select
 end select

or perhaps something like

Code:
 toggle30.visible=frame10=1 and frame19=2
 toggle31.visible=frame19=1
 ...
 ...

your code will be more readable if you give controls meaningful names.

also, without knowing anything about your business, this way may or may not be the best way for users to make selections. Reason I suggest this is that if you add another option you will need to modify your form design and underlying code. You might instead like to consider 'cascading combos' - google to find out more.
 
Hi CJ,

Thanks for the reply - your "case" code looks like the best one for me.

your point over the best layout however has got me thinking and posed a second question:

Although I take on board your comments about updating code and forms etc if further options are needed; the users have all asked for simplicity at the point of use so prefer to visual see all the options and then pick accordingly.

If i'm to continue with this direction, I'd better be clear on the options.

In the sample I've attached above, option group 1 will actually have 17 options.

In group 2, there will be 3 options.

The options displayed in group 3 will depend on what combinations where chosen in group 1 & 2.

My intention for the third group was to have 12 options place holders and have their visbility turn off. Once 1 & 2 groups have been selected, the placeholders would then display the relevent options (from the display Options table) and have their visbility turned on.

For example if "1" is picked in group 1 and "1" is picked in group 2, then i could ask placeholder 1 to display "2" and become visible.

If this changes to "15" in group 1 and "2" in group 2, then placeholder one would need to display "4"

(those numbers are hypothetical and not linked to the attached sample)

Is it possible for the third group to be set at 12 options but to display difference values dependent on the previous selections?

The things we do for easier front end user interface! :banghead:;)
 
Is it possible for the third group to be set at 12 options but to display difference values dependent on the previous selections?
anything is possible, just depends how much wrok you want to put into it

the actual values (1,2,3 etc) would be the same although you could have code to swap them around - code would need to ensure duplicates weren't created and you would potentially have significant changes to make elsewhere since depending on the values in the first two option groups, 1 could mean different things.

You can change the caption (what the user sees) if you wanted.

Personally I think you are building a rod for your own back - visually/practically there are many ways of presenting the options - using sliding scales for options 1 and 2 for example. But without knowing more about what the options are, the rules to be applied, what happens after option 3 has been selected and how you plan to manage later edits, it is not possible to be more specific.
 
Thanks again CJ for your advice.

I've re-attached an updated example for all to see my intentions with the report this will hopefully end up with.

I've also added all the buttons to the form so people can see all the options that will eventually be required:

group 1 with 18
group 2 with 3
group 3 with 12 (but not all visible - that will depend on the choices made in the previous two groups)

The query is based on the sampleLog and the Report on the query.

If I'm understanding this correctly, I've set myself up for a lot of coding because I require the form to display all the options at once?Combo boxes would be easier; yes, but this will detract from the required user interface.

I appreciate this is my choice but unless anyone can suggest a better one that keeps all the options visible, it's one I'm happy to make.

My only issue then is how I set the values of the third group buttons when the previous two groups have been selected?

I understand each of the buttons have a name; in the attached they are called "placeholder X". They also have caption - currently set as "choice X". Lastly they have an assigned value -1 to 12.

If i was to use an "select case" and have 18 of then for the first group, which each contain with them 3 further select cases for the second group ( a lot I know) -

Could i then have options such as:

Placeholder 1.caption = XXX
Placeholder 1.value = X
Placeholder 1.visible = TRUE

All advice appreciated.

Thanks
 

Attachments

My only issue then is how I set the values of the third group buttons when the previous two groups have been selected?
as suggested in post 2

Could i then have options such as:

Placeholder 1.caption = XXX
Placeholder 1.value = X
Placeholder 1.visible = TRUE
in principle, yes. Note that .value is not requied, it is the default property. Also strongly recommend you do not have spaces in your field and control names

If i was to use an "select case" and have 18 of then for the first group, which each contain with them 3 further select cases for the second group ( a lot I know) -
it might be more readable and less code to do it the other way round - the 3 first and the 18 second
 

Users who are viewing this thread

Back
Top Bottom