Results 1 to 10 of 10

Thread: [RESOLVED] combo box in outlook vba not showing items

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Resolved [RESOLVED] combo box in outlook vba not showing items

    Hey,

    I've manged to write with a lot of help from this forum, this small outlook vba code that shows a combo box for selecting items from an mdb file.

    problem is:
    1. When I put this code in the load form of the form it doesn't add any items to the combox, but if I add it to a dummy button then the combox items are loaded ok.

    2. I'd like to add this combo box to a toolbar in outlook and not create a new form for it.

    thanks, and here's my code:




    AccessConnect = "Driver={Microsoft Access Driver (*.mdb)};" & _
    "Dbq=my_DB.mdb;" & _
    "DefaultDir=q:\;"

    Conn1.ConnectionString = AccessConnect
    Conn1.Open

    Set Rs1 = Conn1.Execute("SELECT * FROM Customers")
    Rs1.MoveFirst

    While Not (Rs1.EOF)
    Customer_Select.AddItem Rs1("customer_no") & "-" & Rs1("customer_name")
    Rs1.MoveNext
    Wend
    Conn1.Close

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: combo box in outlook vba not showing items

    Is this in a UserForm or a regular Outlook Form?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: combo box in outlook vba not showing items

    this is in a new form i've added, but what I'd want to do with it is add the combox as a part of a toolbar.
    Last edited by bambo; Jan 13th, 2006 at 08:17 PM.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: combo box in outlook vba not showing items

    So your saying your creating a new Form from the Design the Forms menu? If your wanting to add a combo to a toolbar on your form, does it already have a toolbar on it and you just need to add the cbo?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: combo box in outlook vba not showing items

    ok, I should describe it from the begining:

    the code above is a part of a form I've created with a cbo I've put it and wrote the code.

    what I need in the end is to add a cbo in an outlook toolbar so that the user can choose an item from the list an the code will act upon it.

    my questions are:
    1. how to add the cbo into a toolbar in outlook?
    2. where to put this code so that it loads once outlook is loaded/ the cbo is opened.
    3. where to add an event code for selecting an item from the cbo.

    thank you (and sorry for not beinhg clear on this one)

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: combo box in outlook vba not showing items

    It depends upon the type of form you create it from. Either in Outlooks Form designer, VBA IDE UserForm, VB 6 Form.

    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: combo box in outlook vba not showing items

    (I've created this form in outlook from designer)

    - What I'd like to do is create a combo box toolbar in outlook with this code behind it.

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: combo box in outlook vba not showing items

    robdog? anyone ?

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    586

    Re: combo box in outlook vba not showing items

    common, is this that complicated to do? am I not clear in what I want ? anyone?

  10. #10
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: combo box in outlook vba not showing items

    You will need to create a toolbar using the CommandBars collection. Add a combox to it and populate it. Since there s no control to drag and drop on the outlook form, you need to do this at run time either in VB Script behind the form or in the VBA IDE adding it to the Inspector item.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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