Results 1 to 3 of 3
  1. #1
    dccjr's Avatar
    dccjr is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Colorado Springs, CO
    Posts
    138

    Run-time error when trying to AddItem to Combo Box

    Hi,

    I am new to VBA (and Access). I am trying to populate my two combo boxes but keep getting a run-time errror 2465.
    This is what I have so far:

    Private Sub PopRptType()
    'Add list entries to Report Type Combo Box
    With cbxRptType
    AddItem "Select Chart or Report Type", [Index 0]
    AddItem "Pareto Chart", [Index 1]
    AddItem "RCA Event Summary Table", [Index 2]
    AddItem "Unused1", [Index 3]
    AddItem "Unused2", [Index 4]
    End With
    End Sub

    Private Sub PopConstraint()
    'Add list entries to Report Contraint Type Combo Box
    With cbxConstraint
    AddItem "Select Constraint Type", [Index 0]
    AddItem "Part Number", [Index 1]
    AddItem "RCA Event Type", [Index 2]
    AddItem "RCA Event Category", [Index 3]
    AddItem "Work Area or Cell", [Index 4]
    AddItem "RCA Event Status", [Index 5]
    End With
    End Sub

    Private Sub frmReportsCharts_Load()
    PopRptType


    PopConstraints
    End Sub


    Any help would be greatly appreciated. Thanks.

  2. #2
    dccjr's Avatar
    dccjr is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Colorado Springs, CO
    Posts
    138
    Just deleted and used the Access combo box wizard. Easy, but a little disappointing. I am marking this as solved, but part of me still wants to see what the problem was.

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,627
    Need a dot (.) in front of each AddItem, remove word Index and brackets:

    .AddItem "Select Chart or Report Type", 0
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 13
    Last Post: 10-25-2012, 06:15 PM
  2. Replies: 0
    Last Post: 07-16-2012, 05:42 AM
  3. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  4. Replies: 5
    Last Post: 03-27-2012, 01:40 PM
  5. additem to list using globals
    By dalestorey in forum Programming
    Replies: 0
    Last Post: 03-24-2010, 03:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums