Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Drop-down list based on IDs and showing the corresponding name


This topic is 5006 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted (edited)

Level: Beginner

OS: Win 7 X64 (not listed in profile options)

Hi everyone. This is my first post and I'm rather new to FM so I apologize in advance if my question is very basic.

I'm trying to create a drop-down list with a value list based on IDs and always showing the corresponding name (not the ID).

However the ID must be finally stored in the table.

To do so, I created a value list with the first field referencing to the ID and the second field referencing to the corresponding name, showing values only from the second field.

Back to browse mode, clicking in the field shows indeed the list of names (OK) but once one name is chosen it then shows the ID in the field (not OK). The ID is stored in the table (OK).

Trying to find a solution by changing only the control style from drop-down list to pop-up menu, back in browse mode the name (and not the ID) is always displayed (OK) but the name is now stored in the database instead of the ID (not OK) !

My questions:

  • 1) Is there any reason for such a different behaviour between drop-down list and pop-up menu ?
  • 2) How to always display names and store IDs in the table ?

Edited by Guest
Posted (edited)

Great first post, Casey. Very detailed and clear.

Well, as you've discovered drop down lists show the value entered in the field (the ID in a value list that consists of two fields).

Popup menus show the second field, but store the first (the ID).

It is not consistent from your description that the change from dropdown list to popup menu would NOT store the ID. Something else must have changed.

When a popup menu gets too long to be appropriate, I use a popup window of choices. Here's a demo.

PS: Some people layer two fields when using a drop down list. The top field is not enterable in browse and is the related text field. The bottom field is enterable, and is formatted for the drop down list. Make this field narrow.

PopupSelectDemo2.zip

Edited by Guest
  • Newbies
Posted (edited)

Many thanks for the quick answer and for the demo.

I think that your demo will solve my problem.

I just need a bit more time to fully understand the demo and to adapt it to my needs.

I will post later a follow-up.

Finally, for completeness I've attached a minimalistic example that reproduces the problem I have encounted with the change from dropdown list to popup menu.

EDIT: following your suggestion of adding a related field, I have found one way round the problem: creating a TO and linking the ManagerID field with the ID field of the TO and adding the related field showing the name. However this is not optimal because it creates yet another TO.

TEST_ValueList.zip

Edited by Guest
  • 4 weeks later...
  • Newbies
Posted (edited)

Ok, now I think I understand.

When using a pop-up menu the ID is always stored even if the Table View shows the corresponding name instead.

Indeed, having a pop-up menu means that there's a value list that may show the terminal name instead of the ID.

This can be checked by populating a field using a pop-up menu, then changing this field to an edit box and going in the Table View: the IDs are now shown instead of the terminal names that were previously coming from the Value List of the pop-up menu.

Thanks for your help!

Edited by Guest
Posted

The purpose of a drop down menu is to restrict entries to only certain values. The design purpose of a drop down list object is to allow entry of alternate values. Therefore the actual values of the list item must be visible.

Posted

Hiya Bruce.

I'm not sure if I entirely agree with this statement.

Why would one be putting a value directly in a related table anyway via this method regardless of dropdown or popup? For a custom list, we have the optional Edit.

Finally, one could just paste into popup field anyway...

I think it was something missed by FMI. I wish that FileMaker would allow the second field to be displayed like the popup menu. But thats just MHO. :

Posted

Well, that's the way it works. What you want is reasonable but it isn't what we were given.

Sometimes we want drop down lists to be restricted or to display a related value - but that is not what Filemaker designed.

A drop down list === a field with user editable content. Therefore that content must be directly visible, as entered.

  • 1 year later...
Posted

I downloaded your demo but Windows didn't recognize the file type. What kind of demo is it?

Datasmith

It is a compressed zip file. This means that the file is an archive of one or more other files compressed into one file (a zip file).

You can use programs like:

Winrar: http://www.win-rar.com/download.html

Winzip: http://www.winzip.com/downwz.htm

7zip: http://www.7-zip.org/download.html

to open, extract or view them. (The programs kind of look like a second windows explorer but then for compressed files)

I preferr winrar, I don't know about you. Just test them out :P

This topic is 5006 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.