Jonathan Parminter said:
Thanks Dirk,
I knew I had to have missed something....
Any ideas or suggestions about how to change this setting
on the fly?
I have a form that allows users to select the record they
want to view/edit (or to create a new record). My idea was
to avoid duplicating this form when users want to select
records for reports. The form toggles from form edit
options to reporting options. I only want users to select
a single record for editting to aviod record locking
conflicts in a multiuser environment. However I want to
allow the selection of multiple records for reporting.
With some fancy coding, you may be able to leave your list box set for
multiselect but enforce "single-selectness" through code. A quick test
suggests that code along these lines might work:
'----- start of code -----
Dim mblnSingleSelect As Boolean ' at module level
Private Sub List0_AfterUpdate()
Static varLastSelected As Variant
Dim intI As Integer
If mblnSingleSelect Then
With Me.List0.ItemsSelected
Select Case .Count
Case 0
varLastSelected = Null
Case 1
varLastSelected = .Item(0)
Case Else
If Not IsNull(varLastSelected) Then
Me.List0.Selected(varLastSelected) = False
End If
varLastSelected = .Item(0)
End Select
End With
End If
End Sub
'----- end of code -----
It's about as far from thoroughly tested as you can get, so be warned.