|
-
Jun 21st, 2005, 10:23 AM
#1
Thread Starter
New Member
Calling out values entered into Combo Box
I'm having some issues returning a value from a combo box. Acura, Audi, etc. are added to a combo box in the Load_Menu code, and are taken care of when I load the program. Based on what's chosen in the first combo box, the next combo box is populated as a result. I've shown the first choice simply to save space...
-------------------------------------------------
VB Code:
Select Case Classification.Car_Make.Value
Case "Acura"
Car = 1
Class_Results.Make_Text_Box.Caption = "Acura"
Case "Audi"
Car = 2
Class_Results.Make_Text_Box.Caption = "Audi"
Case Else
Bead = 0
End Select
If Car = 1 Then
Classification.Car_Model.AddItem "CL", 0
Classification.Car_Model.AddItem "Integra", 1
Classification.Car_Model.AddItem "Integra Type R", 2
Classification.Car_Model.AddItem "Legend", 3
Classification.Car_Model.AddItem "NSX", 4
Classification.Car_Model.AddItem "RL", 5
Classification.Car_Model.AddItem "RSX", 6
Classification.Car_Model.AddItem "RSX Type S", 7
Classification.Car_Model.AddItem "TL", 8
Classification.Car_Model.AddItem "TSX", 9
Classification.Car_Model.AddItem "Vigor", 10
Class_Results.Model_Text_Box.Caption = Classification.Car_Model.Value
End If
-----------------------------------------
When I select 'Acura', it pops up with list of models shown above. I then select 'Integra', but it doesn't return that value. Thoughts?
Last edited by DSPDA3; Jun 22nd, 2005 at 10:09 AM.
-
Jun 21st, 2005, 11:33 AM
#2
Re: Calling out values entered into Combo Box
Are you using VBA in an Office app or just VB6?
What do you mean it doesnt return that value?
I take it Classification is a 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 
-
Jun 21st, 2005, 01:13 PM
#3
Thread Starter
New Member
Re: Calling out values entered into Combo Box
Using VBA via Excel.
Yes, Classification is the name of a form. I'd like to run it as a stand-alone program, but have never dealt with VB6. How complicated would this be?
As far as not returning the value, I have two forms set up. One to enter the info, as shown above, and the second to return the info that was entered, along with some info that is determined using the input data. When I input 'Acura', it returns to the appropriate field in the second form. However, when I input 'Integra', nothing is returned.
-
Jun 21st, 2005, 01:55 PM
#4
Re: Calling out values entered into Combo Box
You cant have a standalone program that relies upon Excel unless you assume that the user will have Excel installed.
In your select case statement you do not have the case for Integra listed.
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 
-
Jun 21st, 2005, 02:02 PM
#5
Thread Starter
New Member
Re: Calling out values entered into Combo Box
Integra is not within the Select Case structure. When I select Acura, it displays all the models that fall under Acura, or when Car = 1, according to the code. When 'Integra' is selected in the combo box, I would like the program to return 'Integra', or whatever is selected within the combo box.
Should I have 2 seperate Select Case structures?
-
Jun 21st, 2005, 02:22 PM
#6
Re: Calling out values entered into Combo Box
The code you posted is under the Car_Make combo box click event?
What event is, if any, the Car_Model code in and can you post it?
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 
-
Jun 21st, 2005, 02:44 PM
#7
Thread Starter
New Member
Re: Calling out values entered into Combo Box
The code above is under the Car_Make combo box click event. Actually, all of it was. I seperated the Car_Model stuff into a Car_Model combo box click event, and all is well now.
However I have a new problem. I have the second form set up to go back to the original input form, to enter new data, but it's not clearing the original input values. How do I do this?
-
Jun 21st, 2005, 04:25 PM
#8
Re: Calling out values entered into Combo Box
You have to loop through your controls setting their .Text property to vbNullString or .SelectedIndex = -1 where appropriate.
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 
-
Jun 22nd, 2005, 10:08 AM
#9
Thread Starter
New Member
Re: Calling out values entered into Combo Box
I fixed it. Thanks for the help.
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
|