Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
| Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 26th, 2005, 05:51 PM
Registered User
Join Date: Jan 2005
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default binding recordset with combo problem

Hello Everyone,
I am stuck in a problem for many days now.
In the form, on which I am working, there are 2 dropdown lists (combo box).
The data in the first combo is coming from a list and in the second combo, I am running a query, and depending upon the selection in the first combo, the data in the second combo may come from one of many tables in the database.
What I want is to have control over the data, before it is being displayed in the second combo, as the data in have many null and 'same name' entries. But what I don't want is to change the original data in the tables.

Till now, I have been trying to make use of persistant recordset, that is, by storing the recordset in an external table, changing its data and binding it to the second combo. But I am unable to bind the data.

What in your opinion, is the best approach to accomplish this. A snippet will be of great help as I am not a experienced programmer.


  #2 (permalink)  
Old February 28th, 2005, 04:10 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts


   Open the query for the second combo box and use SELECT DISTINCT to select distinct values in your look up column. THis should work. I made a Table called Table1, populated it with many duplicate values, and then wrote this query, which only comes up with one entry for each value, thus removing duplicates:

FROM Table1;

   You may have a problem if your combo box is binding to another column.



Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding Column Name to a Combo Box. jitu ADO.NET 3 June 27th, 2013 07:35 AM
Combo Box Complex Binding Example? pigparent VB Databases Basics 2 June 11th, 2008 12:08 PM
Binding a datagrid to a recordset roykennedy VB Databases Basics 4 October 28th, 2005 02:15 PM
Image Combo binding Awesomo Pro VB Databases 0 June 21st, 2005 06:28 AM
Weird Combo Box Data Binding Problem kpowers@wppisys.org VB.NET 1 February 12th, 2005 04:52 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.