Access 2007: Limit number of selections in list box

Hello, I have on a form several multiple selection list boxes (multi-select type extended) which several members of this website have helped me on.  The listbox has an afterupdate code which passes its selection onto the field [Reprint Edition]:

Private Sub List48_AfterUpdate()

With Me.List48
If .Selected(.ListIndex) = True Then
    If rst = "" Then
        rst = .Column(0, .ListIndex)
        Else
        If InStr(rst, .Column(0, .ListIndex)) = 0 Then
            rst = rst & ", " & .Column(0, .ListIndex)
        End If

    End If
   
    Else
    If InStr(rst, ",") > 0 Then
        If InStr(rst, .Column(0, .ListIndex)) = 1 Then
            rst = Replace(rst, .Column(0, .ListIndex) & ",", "")
        Else
            rst = Replace(rst, "," & .Column(0, .ListIndex), "")
        End If
        Else
        rst = ""
    End If
End If

End With
Me.[Reprint Edition] = rst
End Sub

I want to limit this to only 1 selection.  I tried setting the box type to no multi-select via the properties menu for the list box, but this resulted in none of the selections being transferred to [reprint edition].  Could anyone help edit the above code to make this work?

Thanks so much,
Bevo
BevosAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
try this codes

Private Sub List48_AfterUpdate()
Me.[Reprint Edition]=me.list48

end sub
0
 
BevosAuthor Commented:
Hi Capricorn1 thanks for the comment.  I tried the code, but it results in the listbox selections not being passed onto [reprint edition].  Any thoughts?
0
 
BevosAuthor Commented:
I got this to work by setting the list-box, multi-select property to none. Thanks Capricorn1
0
 
Rey Obrero (Capricorn1)Commented:
post the codes that YOU are USING.
0
All Courses

From novice to tech pro — start learning today.