473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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 1475
Duplicate entries such as duplicates within the TO/FROM fields or where TO and FROM are the same? Or both?
Oct 2 '09 #2
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
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
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
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
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
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
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...
3
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...
0
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...
2
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...
2
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...
10
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...
7
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...
12
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...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.