I wonder if one of you can help me.
For example i have a database that has a several tables in side :roll: (what's new), so here's the example
RegularityID(Number), Description(Varchar)
2, Week
4, Month
8, Year
So when i add these to a combo box gadget like this
Code: Select all
Query$ = "SELECT RegularityID, Description FROM Regularity ORDER BY RegularityID"
If DatabaseQuery(Query$)
While NextDatabaseRow()
ID.l = Val(GetDatabaseString(0))
Value.s = GetDatabaseString(1)
AddGadgetItem(#Combo_1, -1, Value)
Debug Str(ID) + " | " + Value
Wend
Else
AddGadgetItem(#Combo_1, -1, "No Results found")
EndIf
Else
Debug "DB Error: " + DatabaseError()
EndIf
database. So whe i read the contents of that it gives me the
text (its correct), but i can't use the ID for nothing.
if i use
Code: Select all
AddGadgetItem(#Combo_1, ID, Value)
Is there a way to put the ID in the Combo Box, so i can get the ID
instead of the Text. It's very useful so when i have to insert in the
data in the database i will insert only the ID instead of the Text.
If i only get the text i'll have to make another SELECT to the
Database to know what Text corresponds to the Specific ID.
Is there any way to accomplish this???
Thanks in advance.