cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Trying to set up a combobox displaying two columns

PaulN
10-Marble

Trying to set up a combobox displaying two columns

I am trying to get a control looking something like this (from another piece of software) PaulN_0-1669997469713.pngThe nearest I have been able to get is this 

PaulN_1-1669997602045.png

And even this is showing an error

PaulN_2-1669997717850.png

I have a feeling that what I want is not possible but it would be great if I could be proved wrong!

 

 

ACCEPTED SOLUTION

Accepted Solutions
ttokoro
20-Turquoise
(To:PaulN)

I added all data from excel sheet.

Prime 8 sheet attached.

 

 

View solution in original post

14 REPLIES 14
o.svahn
12-Amethyst
(To:PaulN)

Do not use [ pKa ] - use pKa only.

 

regards 

Owe

PaulN
10-Marble
(To:o.svahn)

That's great but what about getting the dropdown to show the values (in my example 4.74, 2.69 and 5.41) as well as the names - I think that might be a problem which would be a showstopper for me.

DJNewman
17-Peridot
(To:PaulN)

Well, you could cheat the combo box and just put the value in the name.

 

DJNewman_0-1670002458698.png

 

But otherwise the fastest way to check all of the values of the combo box, besides evaluating its contents below it, is to right-click and select edit.

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.
PaulN
10-Marble
(To:DJNewman)

I have gone for your suggestion of putting the pKa values in parentheses after the name.  What I need to do now is find a way of populating the combo with data from an Excel workbook (attached).

PaulN
10-Marble
(To:o.svahn)

Also, how can I set up the list programmatically rather than using the List Editor?

o.svahn
12-Amethyst
(To:o.svahn)

Try this - my best try

 

regards 

Owe

 

PaulN
10-Marble
(To:o.svahn)

I need the dropdown to show the values as well as the names - I don't think it can be done!

PaulN
10-Marble
(To:o.svahn)

I think this is the best compromise

PaulN_0-1670005021922.png

But how can I add the list items programmatically (the source for the data could come either from a DBF database or from an Excel spreadsheet)?

ttokoro
20-Turquoise
(To:PaulN)

You can copy & past this matrix by select all to combo box.

image.pngimage.pngimage.pngimage.png

PaulN
10-Marble
(To:ttokoro)

Thank you

PaulN
10-Marble
(To:ttokoro)

I am attaching a worksheet with a working combo box and data from Excel using READEXCEL.  Can you please help me get that data into a new combo box on the same worksheet?

You had suggested that it is possible to copy and paste a matrix to a combo box but I can't get it to work at all.

Thank you.

P.S. Have also attached the Excel source file 

ttokoro
20-Turquoise
(To:PaulN)

I added all data from excel sheet.

Prime 8 sheet attached.

 

 

PaulN
10-Marble
(To:ttokoro)

Thank you so much.  I have tweaked what you sent for my needs and am very pleased with the result.  I have attached the final version in case you would like to see it.

I would hate to have to set up combo boxes on a regular basis though.  It is shame that there isn't a better way of doing it in Mathcad, and I know that somebody else was trying to do something very similar and ran into the same difficulty.

One last little niggle - it is a shame that the names of the acids are displayed with quotation marks around them.  I don't suppose there is a way around that, is there?

ttokoro
20-Turquoise
(To:PaulN)

The acids are displayed with quotation marks around them. If without quotation, we must define each variable name and its value.
I think the variable name has no space (,), and numbers for first spell. 

Announcements

Top Tags