I took a class in Xojo this weekend and am excitedly exploring designing my first little app. I’ve already run into a problem and I was referred here to get help.
I have a two column, multirow listbox that I need to insert into a database. I have two database tables: one called ‘people_ids’ and one called ‘people_details’. My tables look like this
| PEOPLE_IDS | | PEOPLE_DETAILS |
| dateEntered | datetime | | id | integer |
| timeEntered | datetime | | name | varchar |
======================= | age | integer |
Now, the ‘id’ in PEOPLE_DETAILS is taken from the MAX(rowid) of the PEOPLE_IDS table. Now, here is the code I have:
Dim rs as RecordSet
Dim dr as new DatabaseRecord
rs = app.db.SQLSelect(“SELECT MAX(rowid) FROM people_ids”)
dr.IntegerColumn(“id”) = Val(rs.Field(“rowid”).IntegerValue)
This is where I reach my limit. I need to now loop through the listbox and retrieve the value of current row, cell 0 and current row, cell 1, assign them to a dr column and insert them into the database. I know how to insert into the database but I don’t know 1) how to grab the text from a specific cell in the current row and 2) how to advance to the next row.
Can anyone help? Sorry if this is a lot of useless information. I am trying to give a complete picture.