473,698 Members | 2,943 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I add one list to another list in Access?

4 New Member
I have a TO_EQP field and a FROM_EQP field. I want to make a combo box that displays both fields in a single column but removes duplicate entries. I figured I might have to somehow add one list to the bottom of the other and then remove the duplicate entries. I'm new at this and any help would be appreciated.
Oct 2 '09 #1
7 1481
jmprescott
41 New Member
Duplicate entries such as duplicates within the TO/FROM fields or where TO and FROM are the same? Or both?
Oct 2 '09 #2
jmprescott
41 New Member
First append your field:

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO Table (TO_EQP)
  2. SELECT DISTINCT FROM_EQP
  3. FROM Table;
  4.  
Then you can do something like:
Expand|Select|Wrap|Line Numbers
  1. Dim sqlstr as String
  2. sqlstr = "SELECT DISTINCT TO_EQP FROM Query"
  3. ComboBox.ControlSource = sqlstr
  4.  
I'm pretty new too, but I think that's something close to what you're looking for
Oct 2 '09 #3
newfie86
4 New Member
Thanks! I think we're going in the same direction but is there any way to do this is a query form without having to alter the tables ... maybe this will help describe what I'm looking for

TO_EQP
EQP_A
EQP_B
EQP_C

FR_EQP
EQP_1
EQP_2
EQP_3

And what I'm looking for is this

FR_TO_EQP
EQP_A
EQP_B
EQP_C
EQP_1
EQP_2
EQP_3
Oct 2 '09 #4
Hennepin
25 New Member
SELECT Table1.[fr_EQP] AS FR_TO_EQP
FROM Table1
Union SELECT Table1.TO_EQP AS FR_TO_EQP
FROM Table1;

Here is and sql string that will give you the list.
Oct 2 '09 #5
newfie86
4 New Member
Perfect, exactly what I was looking for.
One more question though, is it possible to add some additional criteria to limit what is outputted in the query? If I have locations for each piece of equipment from the same table is it possible to only output the equipment from a specific location. I know how to do it in the design view (using criteria) but I can only seem to open up the SQL code for the union.
Oct 5 '09 #6
Hennepin
25 New Member
Do each part of the union in a seperate query in design view using criteria. Copy the sql string from one query and append it to the other query. And replace the ending semicolon of the first query string with union.
Oct 5 '09 #7
newfie86
4 New Member
I finally have it working.
I added another query which involved the union and put my restraints in the criteria field.
Thanks everyone, much appreciated.
Oct 6 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

10
3049
by: Jason | last post by:
Hi, I have a few million data items being received by my program and I wish to store them in a list, with each item being inserted in any position in the list. Any performance tips so that my program runs ok? I have checked out the STL and have thought of using vector, set, list, deque and map. I dont know how these things are implemented so not sure which is best to use or if i should implement another data structure. Perhaps any...
3
1984
by: NOSPM | last post by:
Don't know if this is the place to post this, but I will give it a go. :) I have a linklist class, and I have around 20 other classes that need to access the same info (the data) that is contained in the linklist class. What would be the best way to share access to the data between all the classes? Should I just have all the classes adopt the linklist class as a friend, or use a global for the linklist, then access the data
0
1405
by: Miguelito Bain | last post by:
hi everybody- i've got a conundrum... i inherited some old databases, and i'm trying to convert them. i run office xp with access 2002, and all of the databases i manage are either in 97 format or 2000 format. i have a list box that works in access 97 but not 2000. here's my situation...
2
1266
by: ormy28 | last post by:
Hi, back again with another list box problem, 3rd in two days! I am wanting to create a list box that lists all the results of a query. I am using Access 2000, and I'm sure this is easier to do in Access 2003, but seeing as I don't have it I'll have to make do! using the list box wizard I try to base the list box on the query i am using (qryAvailable_Cars). However i always receive an error message saying "No value given for one or more...
2
9468
by: kmnotes04 | last post by:
Is it possible to link one drop-down box to another? For example, if a name is chosen from a drop-down list, can another drop-down list then automatically display the person's office as a result of the choice made in the first drop-down list? If so, how can that be done? I am working with 'Teach Yourself Microsoft Access' and I didn't see it discussed in that book (if it's even possible to do). Or would I just have to create linked tables...
10
2511
by: Ben | last post by:
Hi, I am a newbie with C and am trying to get a simple linked list working for my program. The structure of each linked list stores the char *data and *next referencing to the next link. The problem I get is that I am trying to link a struct that I have defined and its refusing to link. I have tried casting my struct into char * but attempts to cast it back to its original struct to access its contents only seg faults.
7
3134
by: Daniel | last post by:
I want to write a method to remove the last node of the linked list. But the error "Access Violation" exists and the error point to this method. What does it means by Access Violation and how can I debug it? Thanks void RemoveNode(StepNodePtr pList) { StepNodePtr preq, q; q = pList; preq = pList;
12
2442
by: Mark S. | last post by:
Hello, The app in question is lives on a Windows 2003 server with .NET 2.0 running IIS 6. The page of the app in question processes 2000 get requests a second during peak loads. The app uses a Static Object. In this object is a generic List<String>. For every page request this list is looped over only reading not writing each value.
3
2801
by: fish919 | last post by:
Hello All, I am creating a date base in access. I want to create a dropdown list box that is connected to another dropdown list box. You start with a dropdown list that has 5 choices and each of these choices will call another dropdown list box when one of the choices from the first gets selected. (I hope this makes sense) All of this is being done on a single form. I know how to make a (sub) dropdown list not seen before the action...
0
8610
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7740
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.