Solved

Drop down source from separate table

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

932 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

12 Experts available now in Live!

Get 1:1 Help Now