Solved

Drop down source from separate table

Posted on 2013-01-14
6
736 Views
Last Modified: 2013-11-26
I'm working on creating a combobox that will be limited to the data found in a table named "departments" in an ms access db.  The combobox value stored in a separate dataset and saved to a different table in the same database is limited to the list loaded from the "department" table.  I have the Use databound items checked with these settings:

Datasource: DepartmentsBindingSource
Display Member: DepartmentName
Value Member: DepartmentID
Selected Value: tCriteriaBindingSource - Department   <<<-- This is the different dataset and should store the desired value from the combobox b ut the form locks up and I can't tab off or even close the form once something is selected from the drop down list.

I'd love to do this without using ADO.  Is there a way to do this with just the settings available in the combobox itself?

Thanks
0
Comment
Question by:zipnotic
  • 4
6 Comments
 

Author Comment

by:zipnotic
ID: 38776891
I deleted and rebuilt the departmentsbindingsource a few times - no luck

I changed the column definitions in the ms access database to make sure they were the same (tried integer, long integer, and double) - no luck

I deleted the xsd for the separate departmentsbindingsource and added the table to the main datasource - no luck.

I checked to see that the .selectedvalue of the combobox when it changes is actually a number.

i checked in the dataset designer that the query for that table/field was a double. (changed everything to a double)

---Everything looks like it should work.  The drop down expands and you can select an item but as soon as you do nothing works on the form.  You can't close it, you can't go to another box, you can't select something else in the combobox.  If I type a number in the combobox everything works fine.  It even saves it to the database.  What in Sam's Hill could cause such behavior?
0
 

Author Comment

by:zipnotic
ID: 38778902
This is a very frustrating problem.  Spent way too many hours trying to figure it out.  Can ANYONE give some ideas?

Combox Settings:
Datasource: sourcetableBINDINGSOURCE
Display Member: TextColumn from sourcetableBINDINGSOURCE
Value Member: PK Field from sourcetableBINDINGSOURCE
Selected Value: DestinationTableBINDINGSOURCE - FieldToStoreIn

I can type in an integer and it will store it fine but when I try to select one of the drop down values it locks up the form.  No error.  I have to click the stop button in VS IDE to close the program.  I made sure both source column and destination columns are integers and updated the dataset properties for those columns.

Any Ideas?  No way this should be so hard to figure out.  It's got to be something simple.
0
 

Accepted Solution

by:
zipnotic earned 0 total points
ID: 38787471
Figured it out.  It was as simple an answer as there could be.  When you choose the selected value with the expandable arrow it defaults in the databindings properties to 'text'.  I needed to manually change it to selectedvalue.  

Problem solved, lesson learned.
0
 

Author Closing Comment

by:zipnotic
ID: 38787483
Self-answered.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now