473,322 Members | 1,911 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,322 software developers and data experts.

Remove a value from a Combo box once the value has been selected

Hi
I am trying to remove a value from a Combo box once the value has been selected

I have a form with a combo box that uses the following sql for the row source
Expand|Select|Wrap|Line Numbers
  1. SELECT EmpTable.EmpNo, EmpTable.Surname, EmpTable.Forename
  2. FROM EmpTable
  3. ORDER BY EmpTable.Surname;
Once the user selects the employee in the combo box they click a button and the EmpNo is added to the TransTable along with other Fields on the form.
This is then displayed in a data sheet sub form on the original form via a query on the TransTable. Then the prosess starts again only now I don’t want the EmpNo that is in the TransTable to appear in the combo box.

So I should just be able to add something in the criteria of the query above so it does not show rows were the EmpNo exists in the TransTable. This seem like it should be easy but I can’t seem to get it to work!

Can anyone point me in the right direction please?
Dec 15 '07 #1
3 2671
puppydogbuddy
1,923 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1. SELECT EmpTable.EmpNo, EmpTable.Surname, EmpTable.Forename
  2. FROM EmpTable
  3. WHERE EmpNo Not IN (SELECT EmpNo FROM TransTable WHERE TransTable.EmpNo=EmpTable.EmpNo);
Dec 15 '07 #2
Many thanks for the qick reply.
I can see how this works now. I need to improve my sql especially when it comes to nesting select.
Dec 15 '07 #3
NeoPa
32,556 Expert Mod 16PB
Subqueries in SQL may prove helpful if you're interested.
Dec 17 '07 #4

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

Similar topics

16
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not...
5
by: Elvis V. | last post by:
Good morning, I have a table with three fields, Buildings, Floors and Rooms. This is what I would like to do; in my form when I select Building1 in my drop down box for Buildings, when I go to the...
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...
3
by: ken | last post by:
Hi, I want to reset the default value of a combo box everytime someone selects something from its list. I have in the after update event combo.defaultvalue = combo.value. Anyhow this works, as...
0
by: Bob | last post by:
I have a combox column in a datagridview (vs2005 and VB.NET). Once I select an item from the dropdownlist in the combox and do a save, I can no longer remove the item. I can change my selection but...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
2
by: murphyjones | last post by:
I am trying to create an NFL pick'em program for some the upcoming season. I am trying to do this using combo boxes. The rules are that you can only use a team once until you have used every team. ...
7
by: Clamato | last post by:
Hello everyone, I've been working on this for a bit and wonder if anyone can shed some light on my situation. My ultimate goal is to have a user select an item in a list box, have one column in...
1
by: Tim | last post by:
I'm working on a form where a combo box gets its list of values from a table. That same table also contains some "default notes" in other fields. My task is simple, but I'm having a hard time...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.