Results 1 to 7 of 7

Thread: [RESOLVED] MS Access VBA addItem List view

Hybrid View

  1. #1

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: MS Access VBA addItem List view

    OK yes add item is on 2003 and im on 2000.
    I have a workaround by using a value list
    i.e Build a comma delimited string then
    Me.lstEmpStates.RowSource = strStates

    My trouble now is building the string

    While Not rs.BOF And Not rs.EOF

    strStates = strStates & ";" & rs.DataMember(0, 1)
    rs.MoveNext

    Wend

    As you can see I am just wanting to get column 1 into the string as I loop through the record set but the syntax is wrong.

    hlp pls

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: MS Access VBA addItem List view

    what is rs?
    what is datamember?

    if rs is a recordset then use rs("<fieldname>") - will work except (possibly) for null values.

    Also there is a character limit on the list box for values, but if you are not going near that limit you should be ok.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: MS Access VBA addItem List view

    Thanks Ecniv
    http://msdn.microsoft.com/library/de...html/ino2k.asp
    Also keep in mind that there's a limit on just how long a control's RowSource property can be, and that limit is 2,048 characters
    I think that should be enough

Posting Permissions

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



Click Here to Expand Forum to Full Width