|
-
May 31st, 2004, 12:04 AM
#1
Thread Starter
Hyperactive Member
combo box
i m using a dropdown style combox readonly
i m adding items from table as requirement of user
but some times i wanted give blank record to combo from table
that time it gives error property read only or
how can bring it to the first item of combo items
-
Jun 1st, 2004, 10:49 AM
#2
Frenzied Member
I'm not sure what you want. You can set the combobox to the first item with combobox1.selecteditem = 0.
If the problem is that the user can't add an item to the combobox, that's true when you have it set to read only. You'd have to deal with that in code.
Sorry if I misunderstood your question.
-
Jun 1st, 2004, 08:43 PM
#3
If I understand your question correctly, you want to give the user
the choice of a blank item and have it as the first item in the cbo.
When you add the items to the cbo, add a blank item of one
space character. Something like...
VB Code:
Private Sub Command1_Clikc()
Do While oRs.EOF = False
cboCombo1.Additem oRs!Field1
oRs.MoveNext
Loop
cboCombo1.AddItem " ", 0
cboCombo1.ListIndex = 0
End Sub
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
|