platedslicer
New member
- Local time
- Today, 12:11
- Joined
- Jan 31, 2012
- Messages
- 5
This is one of those problems that appear for apparently no good reason.
Essentially, I have a listbox with a _Click() sub that fills some text boxes and other controls with details from the selected register. The primary key to the register is in the hidden last column of the list box.
What happens is, in the first click after a requery, the last column of the listbox returns NULL, when it's not null at all. In fact, if you simply click "End" at the error popup and click the listbox again, it works like a charm.
For the moment it's been patched with the following code:
Works fine from there.
Is there a reason why this happens, and a way to fix it that doesn't involve jury rigging the code?
Thanks in advance.
Essentially, I have a listbox with a _Click() sub that fills some text boxes and other controls with details from the selected register. The primary key to the register is in the hidden last column of the list box.
What happens is, in the first click after a requery, the last column of the listbox returns NULL, when it's not null at all. In fact, if you simply click "End" at the error popup and click the listbox again, it works like a charm.
For the moment it's been patched with the following code:
Dim gayvba As Variant
If IsNull(ListItems.Column(ListItems.ColumnCount - 1)) Then
On Error Resume Next
gayvba = ListItems.Column(ListItems.ColumnCount - 1)
End If
Works fine from there.
Is there a reason why this happens, and a way to fix it that doesn't involve jury rigging the code?
Thanks in advance.