|
-
Jun 17th, 2008, 05:16 AM
#1
Thread Starter
Junior Member
[RESOLVED] Converting cmb.ItemData(cmb.NewIndex) into Microsoft Forms 2.0 Object Library Control
Im currently converting VB.ComboBox to MSForms.ComboBox due to unicode issue.
Is there anyway to imitate the following code?
Code:
cmb.ItemData(cmb.NewIndex) = 0
MSForms.ComboBox doesn't support .ItemData and .NewIndex anymore.
I'm greatly appreciate for responses
-
Jun 17th, 2008, 06:17 AM
#2
Re: Converting cmb.ItemData(cmb.NewIndex) into Microsoft Forms 2.0 Object Library Control
you could try using a hidden column in the combobox as forms2 combo support multi column
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jun 17th, 2008, 06:37 AM
#3
Re: Converting cmb.ItemData(cmb.NewIndex) into Microsoft Forms 2.0 Object Library Control
Are you are aware that MS Forms 2.0 are not redistributable?
-
Jun 17th, 2008, 07:09 AM
#4
Re: Converting cmb.ItemData(cmb.NewIndex) into Microsoft Forms 2.0 Object Library Control
Darn, I don't have a ComboBox control yet that I could advertise! Anyways, there is atleast one freely usable Unicode ComboBox control at Planet Source Code. If you're looking for other controls, I have a textbox, listbox and a label done, but they're not final/stable releases yet.
The advantage over Forms 2.0 is that the syntax is compatible and the controls are freely distributable/usable.
-
Jun 17th, 2008, 08:10 PM
#5
Thread Starter
Junior Member
Re: Converting cmb.ItemData(cmb.NewIndex) into Microsoft Forms 2.0 Object Library Control
I do aware of MS Forms 2.0 is not redistributable.
The application comes along with microsoft office so its not a problem at all
-
Jun 17th, 2008, 10:05 PM
#6
Thread Starter
Junior Member
Re: Converting cmb.ItemData(cmb.NewIndex) into Microsoft Forms 2.0 Object Library Control
I use multiple column approach, it works!
Code:
cmb.BoundColumn = 1
cmb.ColumnCount = 2
cmb.TextColumn = 1
cmb.Column(1, cmb.ListCount - 1) = 0
the .TextColumn is for which column to be displayed in selected list
But i got another issue which is to show only 1 column in populated combobox.
I can find any column hide function for that. Any idea?
-
Jun 18th, 2008, 06:09 AM
#7
Re: Converting cmb.ItemData(cmb.NewIndex) into Microsoft Forms 2.0 Object Library Control
make the width of the first column the width of the combo
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Jun 19th, 2008, 02:24 AM
#8
Thread Starter
Junior Member
Re: Converting cmb.ItemData(cmb.NewIndex) into Microsoft Forms 2.0 Object Library Control
Found the solution 
Code:
cmb.ColumnWidths = "450pt;0pt"
Works like charm! Thanks guys
-
Jun 19th, 2008, 04:11 AM
#9
Re: Converting cmb.ItemData(cmb.NewIndex) into Microsoft Forms 2.0 Object Library Control
Thread moved
Sounds like you are doing this in Access VBA anyways so the end user will need Access installed at a minimium.
Ps, dont forget to Resolve your thread from the Thread Tools menu so others know your question has been answered.
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
|