|
-
Jan 13th, 2006, 05:22 AM
#1
Thread Starter
Fanatic Member
[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
-
Jan 13th, 2006, 02:38 PM
#2
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Jan 13th, 2006, 07:53 PM
#3
Thread Starter
Fanatic Member
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.
-
Jan 13th, 2006, 11:23 PM
#4
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Jan 14th, 2006, 04:22 AM
#5
Thread Starter
Fanatic Member
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)
-
Jan 14th, 2006, 09:16 AM
#6
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
Jan 14th, 2006, 03:31 PM
#7
Thread Starter
Fanatic Member
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.
-
Jan 17th, 2006, 02:13 PM
#8
Thread Starter
Fanatic Member
Re: combo box in outlook vba not showing items
-
Jan 26th, 2006, 05:43 PM
#9
Thread Starter
Fanatic Member
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?
-
Jan 26th, 2006, 06:27 PM
#10
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|