Solved

vb.net combo box tied to access db

Posted on 2015-01-13
6
222 Views
Last Modified: 2015-01-15
I have an app built in vb.net which includes a combobox that ties into an access database field (2 options - Staged and Catalogued).  Everything displays fine and the correct result appears, but in my combo dropdown, i get Staged and Catalogued multiple times, since theyre used multiple times in the access table.  In my combobox, i want its data source to be tied into the access field, but only show those items once.  Any ideas?
0
Comment
Question by:derek7467
[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
  • 3
  • 3
6 Comments
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 40546757
Use Distinct or Group By in your SQL for the source for the combobox.

/gustav
0
 

Author Comment

by:derek7467
ID: 40546831
When i try to do a SQL query i get the below error:

"The schema returned by the new query differs from the base query"

I do this by clicking on the combobox arrow and then add query
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 40546855
Your situation is not quite clear to me but perhaps this can help you:

http://www.experts-exchange.com/Programming/Languages/.NET/Q_23837625.html

/gustav
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

Author Comment

by:derek7467
ID: 40547094
Basically i have a database table that has multiple records, and one of those fields is a status field which is either Staged or Catalogued.  I then display that access database in vb.net using the database wizard.  I also allow edit access from the same vb.net form that displays it.  For the status field, i use a combobox, which is databound to the access db status field.  When i click the drop, rather then it display duplicates because if i have 3 records that are all staged, its going to list staged three times in my combobox, how do i avoid have all show, i just want it to show two options Staged and Catalogued.
0
 
LVL 50

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 40547119
But then the source for the combobox should not be the current dataset but another - using static values or another datatable - that returns only two options selectable.

/gustav
0
 

Author Comment

by:derek7467
ID: 40547271
ahhhhh, ill try that
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

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.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

752 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