Topic: Dropdown Yes/No

I have a form with 4 - DropDown fields.  Each one of them could say "Yes or No".
I have a linked table with Yes/No fields. Each of the dropdowns calls the info from this table.
When I choose Yes in my first dropdown it sets the other 3 to Yes.
-
It looks to me like you can't have multiple dropdowns in the same form getting different data from the same table?
-
Is there an easy way to get "Yes" or "No" in a dropdown field without creating a separate reference table for each one?
-
I use dropdowns in various forms and they all have their own reference tables, so that works fine. And the Yes/No seems to work OK when it's used only once on other forms.
-
I think I may be trying to do something that's not allowed. I guess I can go ahead and create a separate reference table for each Yes/No field I have if that's what it takes?
-
I'm getting myself confused (not too hard smile )
-
I'd appreciate your thoughts
Thanks, Frank

Re: Dropdown Yes/No

Are the comboboxes getting their data from the same field/column in the database or from one table but different fields?

On a clear disk you can seek forever

3 (edited by derek 2020-11-29 17:28:12)

Re: Dropdown Yes/No

Hi Frank, CDB,
Hope you're both keeping well.
You can get away with just 1 table holding your 'yes' and 'no' values.
What you need to do is:
1.  Create multiple relationships (one for each instance where you want to use 'yes' or 'no'').
2.  Create calculated fields to look across to your 'yes / no' table to pull the 'yes' or 'no' description - MVD does the first one 'for free' as part of the standard relationship between 2 tables but for additional relationships between the same tables if you don't do this, your tablegrid just shows noughts and ones.
3.  In the form where you have multiple drop downs, select the correct foreign key relationship when defining your comboboxes.
Of course, doing it this way, you're not limited to just 'yes/no' choices and could put almost anything into just a single table and then simply filter it.(I've not not this in the attached example but give me a shout if it's something you'd be interested in).
Derek.

Post's attachments

Attachment icon frankyesno.zip 337 kb, 230 downloads since 2020-11-29 

Re: Dropdown Yes/No

CDB
Yes I was trying to pull the Yes/No from the same field in the tblYesNo.
As I mentioned it didn't work and I sorta realized that it shouldn't work the way I was trying to make it work.  I just didn't know how to fix it.
-
Derek,
I tested out your solution and it looks like it works fine.
-
When I tested it I forgot to setup the calculated fields.  However when I went to my form it looks like the 4 fields are being populated correctly.  I do see that you use the calculated fields in the tableGrid.  In my program, so far, I'm not trying to display the Yes/No field(s) in a tableGrid.  This may be why things are working without the calculated fields.
-
I have 2 places where I can Print my forms.  I'm not at the point yet where I'm testing my print forms.  But if I need the calculated fields for the print forms then I now know how to do it.
-
Thanks for the help.  You folks always come through for me.  I'm sure glad I don't have to pay for your expertise smile    By now I would have quite a bill.
-
Thanks, Frank