Results 1 to 2 of 2
  1. #1
    ismith is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    39

    How to remove a Chosen product from a Combo box

    Hello,

    I have a combo box on an order form which the user can purchase products.
    Now what i want to do is when the user chooses a product, and wants to buy more, when the drop down is clicked that same product they have bought should not appear in the drop down list.

    To do this, In my product table I have got a 'Chosen' field which has a tick box for yes / no.

    Now this is the following code i am trying to use to update my table once the product has been added into the shopping basket so it doesnt show again.



    Code:
     db.Execute "UPDATE tblProduct SET Chosen = True WHERE ProductID = " & cmbProductID
         lstOrder.Requery
         cmbProductID.Requery
    lstOrder is my Listbox which updates everytime the user prses 'Add' it drops into the listbox to show what they are going to buy.

    This is not working:

    e.g customer purchases productID 5. Customer wants to buy another item and clicks the drop down. ProductID 5 should not be in the drop down.

    But atm my code is not doing that and the item is still showing.

    Can anyone tell me how i can code this so the product thats already been bought doesnt show up again?

    Thanks in advance.

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Look at this video and see if it gives you any ideas on how to handle this. After looking at the video, based upon what you have indicated, you may want to create the second list box, but hide it so the user doesn't see it. Then on close of the form, have the first list box re-populated and the second list box emptied.

    http://www.datapigtechnologies.com/f...tboxtrick.html

    Alan


    Cross Posting: http://www.access-programmers.co.uk/...te=1&p=1135097

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 01-19-2012, 11:59 AM
  2. Remove selection from Combo box
    By bbrazeau in forum Forms
    Replies: 2
    Last Post: 01-16-2012, 03:01 PM
  3. Query returning fields not chosen
    By cam2era in forum Queries
    Replies: 5
    Last Post: 03-23-2011, 11:43 AM
  4. Replies: 2
    Last Post: 08-17-2010, 02:58 PM
  5. Send mail to the chosen ones
    By carstenhdk in forum Import/Export Data
    Replies: 0
    Last Post: 05-18-2010, 11:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums