|
-
May 14th, 2004, 08:49 AM
#1
Thread Starter
Lively Member
Combobox
Here's what I'm trying to do:
I want the user to be able to edit data using a combobox. When the form is filled with data I want the combo box to be filled with the selection based on a query & have the combo be filled with the value from the table. If the user needs to edit this data then on selecting the combo box dropdown, all of the items will be there to choose from, the user selects the new value and saves that new value to the database.
Example:
On form load:
Combobox value shown: Uptown
Combobox filled with :
Downtown
Midtown
Uptown
I need tobe able to have the user then select another value to save. I have the combobox loaded with the values but when it pops the value Downtown is shown because sorts to the top. How do I make the Uptown value show in the combobox but yet still have all values show when the combo is dropped down so the user can select another?
This is what I have so far to fill the combo:
Dim dsShowrooms As WarehouseSet
dsShowrooms = Warehouse.FillShowroomCombo
ComboBox1.DataSource = dsShowrooms.Tables(0)
ComboBox1.DisplayMember = "WarehouseName"
Public Function FillShowroomCombo() As WarehouseSet
Dim sql As String
sql = "SELECT WarehouseCode, WarehouseName "
sql &= "FROM Warehouses "
sql &= "WHERE WarehouseCode <> '99' "
sql &= "ORDER BY WarehouseTypeID, WarehouseName"
Return CType(Me.GetEntitySet(sql, GetType(WarehouseSet)), WarehouseSet)
End Function
I hope I have explained this ......... if I haven't I'd be glad to try again.
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
|