Results 1 to 2 of 2
  1. #1
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Listbox RowSource (A2000/A2003)

    This is just a 'heads-up' to anyone who is switching between Access 2000 and Access 2003.

    I've been developing a database using Access 2000 SP3, which has a lot of listboxes and does a lot of setting and changing of RowSources.

    The Help files say that you need to set the RowSourceType property to Table/Query or Value List or Field List before setting a RowSource using VBA.

    E.g.
    <pre>.
    .
    Me.lstCourseType.RowSourceType = "Table/Query"
    If arglstCampusVal = "ALL" Then 'All Campuses
    Me.lstCourseType.RowSource = "qsrcLstCourseTypes"
    Else
    Me.lstCourseType.RowSource = "qsrcLstCourseTypesC"
    End If
    .
    .
    </pre>


    Access 2000 will happily work without you first setting the RowSourceType property in VBA if it is already set on the Listbox properties.

    Access 2003 is much more fussy. If you do not explicitly set the RowSourceType first, it crashes and burns.

    Be warned!
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Listbox RowSource (A2000/A2003)

    Thanks for the heads-up!
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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