Solved

vb.net combo box tied to access db

Posted on 2015-01-13
6
204 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

706 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

18 Experts available now in Live!

Get 1:1 Help Now