Results 1 to 4 of 4

Thread: Vba Error

  1. #1
    Join Date
    Mar 2004
    Posts
    9

    Unanswered: Vba Error

    Hi there. New VBA user. Trying to learn VBA and I get a debug error at the first additem statement. Just trying to create a list box. Obviously I'm doing something wrong. Please help.
    Sharon)
    Private Sub Form_Load()

    lstFruits.AddItem "Apples"
    lstFruits.AddItem "orange"
    lstFruits.AddItem "pears"
    lstFruits.AddItem "cherrys"
    End Sub

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: Vba Error

    Originally posted by nikko50
    Hi there. New VBA user. Trying to learn VBA and I get a debug error at the first additem statement. Just trying to create a list box. Obviously I'm doing something wrong. Please help.
    Sharon)
    Private Sub Form_Load()

    lstFruits.AddItem "Apples"
    lstFruits.AddItem "orange"
    lstFruits.AddItem "pears"
    lstFruits.AddItem "cherrys"
    End Sub
    Access Version? The AddItem method does not exist for 2000 and previous versions ... Oh, what error?

  3. #3
    Join Date
    Mar 2004
    Posts
    9
    Hi there. Thanks for the response. I'm using 2000. I guess that additem method does not work for 2000?? What is the syntax for 2000 list boxes or combo boxes?? Thanks again.
    Sharon

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by nikko50
    Hi there. Thanks for the response. I'm using 2000. I guess that additem method does not work for 2000?? What is the syntax for 2000 list boxes or combo boxes?? Thanks again.
    Sharon
    Correct. Your choices are to make the listbox a Value List and concat the items together sepearated by a ";" in the RowSource -or- make the listbox Table/Query based and specify in the RowSource either a query name or a direct SQL statement and then Requery the listbox ...

Posting Permissions

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