D
DS
I'm using this code to unselect an item in a listbox.
Private Sub List34_Click()
Dim I As Integer
For I = 0 To Me.List20.ListCount - 1
Me.List20.Selected(I) = False
Next I
End Sub
This works fine if the Listbox is not locked. However, I have an Edit
button on the form which unlocks all of the fields, after your done the
fields become locked again. Thats when this code runs to unselect
whatever was selected in the listbox. If I keep the listbox unlocked
and enabled it works fine, if I disable and lock the listbox the code
doesn't work. Any help appreciated.
Thanks
DS
This says that you can't lock a field that has unsaved changes. Is a
unselect a change?
Private Sub List34_Click()
Me.List20.Enabled = True
Me.List20.Locked = False
Dim I As Integer
For I = 0 To Me.List20.ListCount - 1
Me.List20.Selected(I) = False
Next I
Me.List20.Enabled = False
Me.List20.Locked = True
End Sub
Private Sub List34_Click()
Dim I As Integer
For I = 0 To Me.List20.ListCount - 1
Me.List20.Selected(I) = False
Next I
End Sub
This works fine if the Listbox is not locked. However, I have an Edit
button on the form which unlocks all of the fields, after your done the
fields become locked again. Thats when this code runs to unselect
whatever was selected in the listbox. If I keep the listbox unlocked
and enabled it works fine, if I disable and lock the listbox the code
doesn't work. Any help appreciated.
Thanks
DS
This says that you can't lock a field that has unsaved changes. Is a
unselect a change?
Private Sub List34_Click()
Me.List20.Enabled = True
Me.List20.Locked = False
Dim I As Integer
For I = 0 To Me.List20.ListCount - 1
Me.List20.Selected(I) = False
Next I
Me.List20.Enabled = False
Me.List20.Locked = True
End Sub