Can you set the multiselect property value of a List Box at run time in Access 2003 SP2? If so, continue to read the message below.
Here is a little bit of code behind an option group that generates this error message when option 2 or 3 is selected:
“Run time error 2448” “You can’t assign a value to this object.”
Debug points to this line
.MultiSelect = 2
Private Sub Frame5_AfterUpdate()
‘use this procedure to populate the list box control
‘if daily – lstFrequency disabled
‘if Weekly – lstFrequency values = mon, tues, wed, thurs, fri, sat, sun; multiselect = none(0)
‘if monthly – lstFrequency values = 1 to 31; multiselect = extended(2)
‘if EOM – lstFrequency disabled
Dim i As Integer
‘1 = daily; 2 = weekly; 3 = monthly; 4 = eom
i = Me.Frame5.Value
Select Case i
Case 1 ‘daily
Me.lstFrequency.Enabled = False
Case 2 ‘weekly
With Form_frm_Process_Rpts.lstFrequency
.Enabled = True
.MultiSelect = 0
.RowSourceType = “Table/Query”
.RowSource = “tblWeekdays”
End With
Case 3 ‘monthly
With Form_frm_Process_Rpts.lstFrequency
.Enabled = True
.RowSourceType = “Table/Query”
.RowSource = “tblMonthDays”
.MultiSelect = 2
End With
Case 4 ‘End Of Month
Me.lstFrequency.Enabled = False
Case Else
End Select
Thanks all,