Data binding problem

bradleyd60

New member
Joined
Nov 2, 2009
Messages
4
Programming Experience
Beginner
I have an app with a similar setup and am running into a snag in VS2008 Express.

Access Database w/ Year/Date/Title/Borrower/Out Columns.
(Year would be a set year i.e. 2009 and Date would be the date within that year i.e. 0115 or Jan 15 - Both are combo boxes on interface.
Title is just text - title of item in a text box.
Borrower is name of person checking out item in a text box.
Out is boolean Yes or No in a text box.)

This is a Lending Library app that I'm making. I have the database and interface set up - however this is my issue:

When I debug the program, and I select Year, it will display the other fields as it's supposed to. However, when I drop the combo box back down, the sort order is off. Let's say the items were 1-10 - and then I selected 5. When I dropped it back down, the order would be 5,2,3,4,5,6,7,8,9,10.

Funny thing is that within the design mode, if I select my combo box, and look at the Data Binding Mode options (Data Source, Display Member, Value Member, Selected Value) and have Data Source, Display Member, and Selected Value all set to the data set/Year then it doesn't scramble the order. However, it won't let me select anything outside the combo box - i.e. I can't select item "10" and then click my check out button to check the item out to "borrower"... I've tried every imaginable combination of these settings, and to no avail :(

I don't know how to hard code all these functions, so I just used the connection and data binding wizard - but this seems like a simple app in my mind for a beginner to do - and I'm quite frustrated that I'm having to seek help.

But, it's been nearly 4 weeks of constantly trying new things, and nothing gets it right :(

Any and all advice is immensely appreciated!!!!
 
This would add a rolling ten years to your combobox. Would that help?
VB.NET:
Dim i As Integer
  For i = 0 To 10
       ComboBox1.Items.Add(Year(Now) + i)
  Next
 
Hack,

Thank you for your reply - however that didn't fix the issue. I actually just decided to leave this a list box w/ data binding, and it works fine... it doesn't lose the sort order/etc... Not sure why combo box loses the sort order... Oh well.

Thanks again,
Bradley
 
Please keep each thread to a single topic and each topic to a single thread. If you have a new, unrelated question then please start a new thread. I've started a new thread for your new question here.
 
Back
Top