473,770 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deleting Items from a combo box once selected

6 New Member
Hi All,

Thanks to those that have helped me before.

It’s been a couple of weeks since I posted (I can only play with this during my spare time at work) so here’s the set up again- we receive many “little” shipments of four different versions of something. We combine these into one “big” shipment which we send out to be processed.

Currently I have one main form for the big shipments, based off of a “big shipment” table and a subform, based off of a query. In the subform (a continuous form), the user selects the little shipments to be included in the big shipment from a combo box (based of a query). The quantity of each version, for each little shipment, auto-fill and I get a grand total for the big shipment.

I want the user to only be able to select little shipments that have not been included in a big shipment from the combo box. There is a yes/no field in the little shipments table and the combo box is filtered to let only those marked “no” show up. When a user selects a little shipment, then the Sent field is automatically updated to Yes.

Everything works except when I close the main form and open it again, all the entries in the combo boxes have disappeared. Which, now that I think about it, makes sense. If the combo box is filtered, then the ones marked “no” will no longer appear in the query, so they aren’t going to appear in the combo box.

However, I am not sure how to get around this. Can someone point me in the right direction? Is there another way of doing the same thing?

Thanks
Chez
Dec 13 '07 #1
1 2424
NeoPa
32,573 Recognized Expert Moderator MVP
It seems to me you're asking it to do two different (mutually incompatible) things on the same form.
If the form needs to show existing records which have "little shipments" already selected and assigned, you simply cannot restrict the ComboBox to those items that haven't been selected yet.
You could try a check in the AfterUpdate procedure for the ComboBox that cancels the update if you try to add an already used item.
Dec 14 '07 #2

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

Similar topics

4
26474
by: Georges Heinesch | last post by:
Hi. I have a combobox with a value list of 4 items. My code needs to know the number of items in that combobox. How can I use VBA to get the number of items in a combobox? TIA --
1
1706
by: Tim | last post by:
Hi, I'm very new to .NET and am programming in C#. I have a web application where i have two list boxes. Its kind of like a shopping card where you can add items from one 'locations' list box to the 'locations selected' (cart) listbox. I have a hirarchy of locations - main locations and sub locations. main locations being the parent locations, and the sub locations being the child locations. I want to be able to check to see if the...
10
4403
by: A_PK | last post by:
I am writing mobile application using Vb.net when i click the last row of list view, and try to delete it.... will promtpy the following message "Additional information: ArgumentOutOfRangeException" what does that mean ? I can delete any row without problem but except last row only....
2
4448
by: Chesne | last post by:
I would like to be able to utilise a combo box where once an item has been selected then that item no longer appears in that list. Is there some code anyone has which will achieve this? If I select an item in to the subform I need to be able to reinstate it in the combo box to use again. Hey, am I asking too much? TIA - Ray
4
5427
by: datasec23 | last post by:
I have read through the threads and have been unable to find an answer to my simple question and this newbie is stuck. Here is what I am trying to do. I have a combo box that contains a list of items that are pulled from a table. I want to populate another box (text, combo) doesn't matter what with the selected information from the first box. Everytime I select something in the first box, it overwrites what is in the second box. I have...
2
3895
by: banderson | last post by:
Hello, I have a data entry form for a table with information about buildings and am having a problem making a combo box do what I want. I would like to make the combo box show a list of unique bldg mgmt company names and then to open a building management company form to show all records with this name, so the user can find the correct branch location to select. Then, upon closing the building management company form, the active/selected record...
2
1667
by: Brad Pears | last post by:
I am working on a new vb.net 2005 project using SQL server 2000 as the backend db. I have a listview where control I want a user to be able to select either just one or multiple rows in the listview and perform an action on them. If the user chooses to delete these rows I wonder what the best way to handle the deletion of multiple rows is... Right now I have a stored procedure for deleteing jsut opne row. i.e delete from {tablename}...
6
2909
by: henry.onovwaka | last post by:
Can someone help on this problem. I have a combo box of, say three Items, selected from a table that serves as the lookup: E.g. 1 Earth, 2 Pine, 3 Earth Grave The combo box is on the subform. If the user selects any of the item, that item so selected should not appear in the list again; or The user should be warned about previous selection.
2
5071
by: mygirl22 | last post by:
Hi, I used this code to created 2 combo boxes General and Specific...and Only show Specific (Combo B) when Combo A is chosen..... What i need now is to know how to assign specific values to the items in combo b (Specific).??? If i chose a sode, Fanta, i want the total price to be $20.00 (this price will show up in the finial price box....Please Help!! drinkComboBox.Items.Clear() 'Clears the old items out of the drinkComboBox ...
0
9618
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10259
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
10101
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
10038
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
6710
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
5354
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...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
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
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.