2 column dropdown list (select)

Is there a way to show more info in a select list (dropdown)? Like seeing the fisrt name when choosing the name in a list…

Thank’s

Re: 2 column dropdown list (select)

In the Lookup procedural, you can create the sql sentence

then in these process you can ADD another field list (see the imagen2.jpg file)

Aquiles

imagen2.jpg

Re: 2 column dropdown list (select)

Thank’s for the reply!

I already tried that but the result is a combination (concat…) of the 2 fields in the dropdown list. The second field should only be a “view only” field to get the right person in the list.

Here is what I get in the sql construction box.

SELECT Nom, sc_concat(Nom, Prenom)
FROM clients
ORDER BY Nom, Prenom

Re: 2 column dropdown list (select)

sql builder down there is a texbox with the “separator” put here for example “-----” or “] [” to separate these fields.

XXXXXXXXXX ____YYYYYYYYYYYYYY
XXXXXXXXXX] [yyyyyyyyyyyyyyyy

Re: 2 column dropdown list (select)

Sorry no results at all…

What I am looking for in the dropdown list is: 1- The Family Name (that will be kept in the select box for the search fucntion) and a second column with the First name that is only there to identify the right person in the list that has a lot of identical family names…

I am after the same thing: in the Dropdownlist would like say in like a nice 4 Column So looks like this:

Staff Reference | Surname | First Name | Other

0001 Healey Aaron Christopher

But so they are inline of course

Something like this i would like, as in Access it does it like this in Design View but would love to be able to do it with Scriptcase.

Thanks
Aaron

Hi - this not perfect but this is what I have done to have 2 lined-up columns in a lookup (using MySQL backend)…

This dropdown shows the name of an agency, followed by the name of the user who added that agency (because sometimes more than one user will use the same agency) - so I need the admin user to be able to see which agency was added by what user…

  1. On the lookup query, I have…

SELECT AgencyID, CONCAT(AgencyName, ’ ‘, REPEAT(’-’,25 - LENGTH(AgencyName)), '> ', User)
FROM tblagencies
ORDER BY AgencyName

This concatenates the field “AgencyName” with a single space, and then a variable amount of pad characters (’-’) to make it a maximum of 25 characters (obviously you make this whatever “field size” you want), and then a ‘>’ character; so that the full length of the left column in the lookup will be 27 characters.

  1. Change the CSS for the input field (on the page where your lookup SQL is) to be a mono-spaced font, e.g. Courier New

Points to note:

  1. I’m NOT using sc_concat() - that function doesn’t seem to allow passing MySQL functions (e.g. RPAD() which would have been helpful - SC developers please take note) - so I used the standard MySQL CONCAT function (or whatever if your DB is not MySQL).
  2. I am using ‘-’ characters as pad characters because it looks like SC strips leading and trailing blanks when processing the lookup - so padding with spaces is pointless.
  3. No reason why this cannot be extended to as many columns / fields as required.

Hope that helps.

Capture.JPG