>Put a "Clear" command button on your form. Here is the code to put in the
>Click event. Change the names to suit your form:
[quoted text clipped - 18 lines]
>>
>> Martin Dashper
I don't think you can.
> Yes, but how do I get the list to do that itself?
> What I want is to be able to select an item and then, by clicking
[quoted text clipped - 24 lines]
> >>
> >> Martin Dashper
To reset a single-select list box, set its value to Null.
To accomplish what you're trying to do, declare a couple of module-level
variables:
Dim mbooCtrl As Boolean
Dim mstrSelected As String
(this assumes that your listbox is bound to a text field. If it's bound to a
numeric field, use Dim mlngSelected As Long, or whatever else is
appropriate)
Now, add the following code:
Private Sub lstEmployee_Click()
' If this is the same record as previously selected AND
' the Ctrl key is depressed, clear the listbox
If Me.lstEmployee = mstrSelected And mbooCtrl Then
Me.lstEmployee = Null
Else
' Otherwise, just keep track of which record has been selected.
mstrSelected = Me.lstEmployee
End If
End Sub
Private Sub lstEmployee_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
' Sets mbooCtrl to True if the Ctrl key is depressed
' along with the mouse click, False otherwise
mbooCtrl = (Shift And acCtrlMask)
End Sub

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> Yes, but how do I get the list to do that itself?
> What I want is to be able to select an item and then, by clicking
[quoted text clipped - 24 lines]
> >>
> >> Martin Dashper
Martin Dashper - 13 Dec 2005 09:31 GMT
Many thanks Doug, it works a treat.
Martin
>To reset a single-select list box, set its value to Null.
>
[quoted text clipped - 62 lines]
>> >>
>> >> Martin Dashper