• multiselect property value (2003 SP2)

    Author
    Topic
    #455859

    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,

    Viewing 0 reply threads
    Author
    Replies
    • #1136552

      If you look at the help file you will see for the Multiselect property this little sentence :

      This property can be set only in form Design view.

      • #1136559

        Thank you. I must have missed that. In order to restrict users to one selection when option 2 (Weekly) is chosen, I suppose I must make a different list box visible where multi-select is set to 0.
        Thanks again!

    Viewing 0 reply threads
    Reply To: multiselect property value (2003 SP2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: