Forum > Database



Can someone guide me on the DBCombobox please.
I have an underlying SQL table and I'm making a "front end" for easy editing.
Values in fields are mostly numeric but are meaningless to a user.
The DBCombobox will be linked to an integer field where values denote a widget style.
I want the user to use the DBCombobox and select a user friendly word  from a list which then assigns the correct value into the field.
I've read sections that mention looping through many if statements and assigning values via code but I was wondering if there's a way that a value can be assigned from a string list.
"Male Armour" , 10
"Female Armour" , 11
"Weapon" , 5
Selecting Female Armour in the dropdown list would apply 11 as a value into the field.

Thanks for any info.

You need TRxDBComboBox from RXLib for that. Set the items in Values property to match the list in the Items property.

RX Lib:

(Open rxnew.lpk and install it)

Thanks for the reply.

Opening that link gives me a xml type view on screen and save target wants to give me a txt file.

When the URL starts with something like "https://svn", you are supposed to use a program like Tortoise to download it.

Its easy, install Tortoise, then make a directory called "rxnew" under lazarus components for example, then rightclick the dir and chose "check out". Now enter the link I gave you for RXLib and download it. After that you can install RX.

SVN (subversion) is how many of us get the latest versions of Lazarus and FPC, the development versions.

I missed the fact that it was an svn.
I already have tortoise installed so it should be ok.


[0] Message Index

Go to full version