Solved

Drop down source from separate table

Posted on 2013-01-14
6
740 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is about my first experience with programming Arduino.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

791 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