Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

vb.net combo box tied to access db

Posted on 2015-01-13
6
Medium Priority
?
231 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 51

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 51

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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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 51

Accepted Solution

by:
Gustav Brock earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

730 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