Hello, I have been working on a database with the help of some of the users of experts exchange and I was hoping I could get some comments about how to change how my form's list boxes are functioning. I have several list boxes all of which pass their values to a variable nst and then this value is passed onto the [notes] field on my form/table. The way the list boxes function now works pretty well, but I would like a user to be able to de-select a list choice in the listbox. That is to say if he or she clicks one of the items it removes it as a selection. The code for the list boxes right now is as follows:
Private Sub List58_AfterUpdate()
If .Selected(.ListIndex) = True Then
If nst = "" Then
nst = .Column(0, .ListIndex)
If InStr(nst, .Column(0, .ListIndex)) = 0 Then
nst = nst & ", " & .Column(0, .ListIndex)
If InStr(rst, ",") > 0 Then
If InStr(nst, .Column(0, .ListIndex)) = 1 Then
nst = Replace(nst, .Column(0, .ListIndex) & ",", "")
nst = Replace(nst, "," & .Column(0, .ListIndex), "")
nst = ""
Me.[Notes] = nst
Does anyone know if it is possible to accomplish what I have requested, and if so how should the above code be modified?
Thanks in advance for any comments,