Empty Recordset - code review needed

I think your database is just fine. I think the problem is you’re putting the IRef field from your recordset into the RowTag and not the first cell in the row, but you’re trying to get the IRef value from the first cell of the row and not the RowTag of the row.

MainWindow.IncidentsListbox.RowTag(MainWindow.IncidentsListbox.LastIndex) = IncidentsRS.Field("IRef").StringValue

If you look at your code above your after you add a row, you never populate the first cell with anything. You start with the second cell and populate the RowTag last.

Did you try changing your code to what I suggested above?

Johnny - where exactly do I put your line of code above??
I have spent 1.5 days staring at this problem and now cannot even remember my own name :frowning:

Ahhhhhh - that fixed it!!!
You were exactly correct - nothing in the listbox column, but in the RowTag instead.
I was confusing listbox column 0 with database column 0!!!

Thank you so much EVERYONE - I really appreciate your help!

Replace:

Dim SelectedIRef As String = MainWindow.IncidentsListBox.cell(MainWindow.IncidentsListBox.ListIndex,0)

With:

Dim SelectedIRef As String = MainWindow.IncidentsListBox.RowTag(MainWindow.IncidentsListBox.ListIndex)

All fixed - THANK YOU SO MUCH!!!

We can help you with that one too … Margaret Thatcher, I believe ^^

Margaret is my Sister - did I tell you about her?