Solved

Drop down source from separate table

Posted on 2013-01-14
6
744 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
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…
Simple Linear Regression

717 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