473,387 Members | 1,864 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.

Excluding Previously selected Combo Box record to current Combo Box

I have a form for transfers, which has on it 2 combo boxes, each with the
same list of locations in them. I want combo box 2 to include all the
locations apart from the one selected in combo box 1. E.g. A user can't
transfer something from NY to NY. Can anyone suggest how I do this?

Thanks in advance
Nov 13 '05 #1
2 1541
Will, just exclude the value in your combobox (cbo1) from the result
set of your query for combobox2. Something like this: (tblRowSource)
is whatever your current query is.

SELECT ....
FROM tblRowSource
WHERE ...
AND tblRowSource.Field<>Forms!MyForm!cbo1

Nov 13 '05 #2
Rog
Let's say you have a table called tblLocations with field fldLocation.
Populate it with all your locations.

Your form, let's call it yourform, has comboboxes cboFrom and cboTo.
Rowsource for cboFrom is "Select fldLocation from tblLocation order by
fldLocation".
Rowsource for cboTo is "Select fldLocation from tblLocation where
fldLocation <> forms!yourform!cboFrom order by fldLocation".

In the after update event of cboFrom, type Me!cboTo.Requery.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: PeteCresswell | last post by:
I'm looking for some code that makes a list presented in a subform autoscroll in response to the user typing - like a combo box dropdown or a regular ListBox does. I.e. The user is looking at...
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
8
by: AA Arens | last post by:
Hi I do have a products table and products-parts table in my Access 2003 database and log all services into a form. I do have at least the following two combo boxes on my form: - Choose...
9
by: cocacrispy | last post by:
I've read many forum posts and articles and haven't made any headway with this. Let me describe my tables and when I'm trying to do and see if any one can help me. I have an items table, a...
4
by: copewithit | last post by:
Hi all, I'm trying to modify a record (in this case the name associated with the record) to a new name selected by the user in a combo box. Right now I have Single Form with a subform in datasheet...
10
by: Declining | last post by:
Hello All, I’d like to make an enquiry as to how to set the default value in a combo box to the previously select value in MS access 2003. I have 50 or so possible items that can be selected...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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,...
0
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...

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.