Solved

vb.net combo box tied to access db

Posted on 2015-01-13
6
210 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
  • 3
  • 3
6 Comments
 
LVL 49

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 49

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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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 49

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

809 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