|
-
Nov 22nd, 2004, 01:21 AM
#1
Thread Starter
Hyperactive Member
Combo List control
Hello everybody
Can anyone point me to a link on how to use a combo list control?
I want an unbounded combo list which will be populated from a table of a database. The combo list should be populated with a descriptive field, which the user will use to make his/her selection. When the descriptive field is selected a code field should be returned.
Hope I didn`t baffle you guys with all the details!
thx, in advance
George Papadopoulos
-
Nov 22nd, 2004, 01:30 AM
#2
Loop through your rs ading items to the cbo.
Something like this
VB Code:
Private sub command1_click()
do while rs.eof = false
combo1.additem trim$(rs.fields(0).value) & vbnullstring
combo1.itemdata = rs.fileds(1).value 'must be a numeric value
'.ItemData is like a tag field on other controls.
rs.movenext
loop
end sub
Not sure what you mean by code filed but this should get you started.
HTH
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 
-
Nov 22nd, 2004, 03:24 AM
#3
Thread Starter
Hyperactive Member
ok. thx. but what does the Trim function do? Does it trim the string to the components on screen dimensions?
-
Nov 22nd, 2004, 03:44 AM
#4
Trim removes leading and trailing blank spaces in the string.
Highlight the word Trim in your code and press F1
-
Nov 22nd, 2004, 03:56 AM
#5
Thread Starter
Hyperactive Member
Is it compulsory to enter the itemdata property of the component? That is because I have no Integer field in my table. The primary key is a unique alphanumeric string I construct!
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
|