|
-
May 1st, 2007, 04:48 PM
#1
Thread Starter
Addicted Member
open form with occording combobox value
Hi All
My form VB2005 has 4 comboboxes and I would like when form is open each combobox show value ALL. I coded in LOAD procedure like this
Code:
Me.EmpComboBox.Text = "ALL"
Me.DeptComboBox.Text = "ALL"
Me.TypeComboBox.Text = "ALL"
Me.YearComboBox.Text = "ALL"
and when form is open I have other items from each list not like I expecte. What is my error?
Thanks.
-
May 1st, 2007, 05:50 PM
#2
Re: open form with occording combobox value
Exactly what are your expectations and what are the results you get?
-
May 1st, 2007, 10:14 PM
#3
Thread Starter
Addicted Member
Re: open form with occording combobox value
I'm expecting that each combobox will display ALL. But when form is open comboboxes display some value from own lists.
Thanks.
-
May 1st, 2007, 10:33 PM
#4
Re: open form with occording combobox value
Have you set the DropDownStyle properties to DropDownList? If so then the text field cannot show any value that is not in the list. Is "ALL" in the list? If not then the field can't show it.
-
May 1st, 2007, 11:33 PM
#5
Thread Starter
Addicted Member
Re: open form with occording combobox value
All comboboxes have set the DropDownStyle properties to DropDownList. And "ALL" in the list of each combobox.
Thanks.
-
May 2nd, 2007, 12:21 AM
#6
Hyperactive Member
Re: open form with occording combobox value
try
Code:
ComboBox.SelectedItem = "ALL"
if "ALL" is in the collection of items.
Prefix has no suffix, but suffix has a prefix.
-
May 2nd, 2007, 12:26 AM
#7
Re: open form with occording combobox value
Then set the SelectedItem property, not the Text property.
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
|