Page 1 of 1

Database table into option button

Posted: Wed Nov 14, 2012 4:55 pm
by theoGA61d2
Hi,

I have a problem figuring out how to do this:

I have a table which has a id and an description

I want to show the user the description is an option or combo button but when the choose an option have the ID as this will be linking in to another table as reference.

Those anybody have an idea how to solve this?

Thanks

Theo

Re: Database table into option button

Posted: Wed Nov 14, 2012 5:59 pm
by sturgis
When you query the database, query both items ( of course) with a delimter of some type.

THen you should have a list of items and rows like

my item id 1,1
my item id 2,2

Convert this to an array with split.

split myData by return and comma -- edited to fix horrendous typo.

This gives you an array where the keys are "my item id..." and the value is the id itself

THen you can use "the keys of myData" to populate your button, and
myData[whateverkey] to reference the id.