I’ve decided to move from Ms Access to Xojo programming and naturally there are new concepts that I need to acquire, despite some similarities between Realbasic and VBA.
At the moment I’m struggling to retrieve the rowtag from a combobox control.
I set it right after the adding a new row, and the combobox populates correctly, but when I try retrieve the Rowtag associated with the selectedrowindex I get a blank value. Instead, for testing purposes if I retrieve within the populating loop I get the correct value.
var Paises as rowset
try
Paises = App.BaseDados.SelectSQL(“SELECT DESC_PAIS As Pais,ID_PAIS FROM tGE_Paises ORDER BY DESC_PAIS”)* catch error as DatabaseException
messagebox(error.Message)* end try
Dim i, n as integer
i=0 n=paises.rowcount
While i<=n
Pais.AddRow(Paises.Column(“Pais”))*
Pais.RowTagAt(i)=Paises.Column(“ID_PAIS”)*
paises.MoveToNextRow*
i=i+1* wend
Is it a scope related issue? What am I missing here?
It’s three backticks ``` then a new line, then your code, then three more backticks.
You can also select the code and click the </> icon in the post editor.
Sorry, the codes is as follows: indent preformatted text by 4 spaces
var Paises as rowset
try
Paises = App.BaseDados.SelectSQL(“SELECT DESC_PAIS As Pais,ID_PAIS FROM tGE_Paises ORDER BY DESC_PAIS”)
catch error as DatabaseException
messagebox(error.Message)
end try
Dim i, n as integer
i=0
n=paises.rowcount
While i<=n
Pais.AddRow(Paises.Column(“Pais”))
Pais.RowTagAt(i)=Paises.Column(“ID_PAIS”)
paises.MoveToNextRow
i=i+1
wend
I’ve looked at your code, and mine should work as well.
I’ve a rowset with tow fields DESC_PAIS (countries name Varchar(50)) and ID_PAIS (country ID Varchar(2)), the DESC_PAIS is used in the add row value, and ID_PAIS should be the Rowtag of the added row.
I get not error while populating the combobox, but in the change event of the combobox I test to get the rowtag with no sucess!