Solved

vb.net combo box tied to access db

Posted on 2015-01-13
6
209 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

920 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

13 Experts available now in Live!

Get 1:1 Help Now