Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    multiselect property value (2003 SP2)

    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,

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: multiselect property value (2003 SP2)

    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.
    Francois

  3. #3
    2 Star Lounger
    Join Date
    Jun 2001
    Location
    Virginia, USA
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: multiselect property value (2003 SP2)

    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •