I’ve got a very puzzling issue and don’t know how to track it down. I’ve got 2 windows each with a listbox of data. Double clicking on a row copies the row data to a new detail window putting the data into fields. Basically the identical code in each. One works, one doesn’t. Here’s an overview.
A set of records is downloaded to a local app into a window with a listbox of 5 columns. There’s more columns in the data than can be displayed so the data is put into a record class and stored as a row tag for each row. If the user wants to view the details for a row in the listbox they double-click it. The rowtag is parsed and the data is put into fields on a new window. Here’s a sample of the code that works:
Var cRecord As RecordClassClient=me.RowTagAt(me.SelectedRowIndex)
//INDIVIDUAL DATA TAB PANEL
winClientRecord.txtClientData(0).Text=cRecord.id_clients
First line it reads the rowtag and puts the data into a record class. It does that perfectly. Next it goes through the cRecord class and puts the correct data into the correct field.
Here’s the code that does not work.
Var cRecord As RecordClassDoctor=me.RowTagAt(me.SelectedRowIndex)
//INDIVIDUAL DATA TAB PANEL
winDoctorRecord.txtIndividualData(0).Text=cRecord.first_name
This reads the rowtag correctly but then errors on the next line with an “OutOfBoundsException”. These are the first lines of the double-click method for each listbox.
I’m at a loss on this one.