Results 1 to 7 of 7
  1. #1
    xtrareal22 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2013
    Posts
    27

    delete a value in a combo box

    Hello.i am doing a stock management system for a cafe.i have a stock,sales and reorder form.In my reorder form i have the primary key field as a comb box which displays a value based on a query that shows which items have to be reordered.So this combo box displays the item name


    So for example Pepsi and coke need to be reordered.After i first select coke and reorder it first and save and then do Pepsi i want the combo box to not display coke but only Pepsi as coke has already been ordered.What should i do?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    You have to identify that Coke has been reordered. Then in your query you need to do something like this (concept only)

    Select StockName from StockTable
    WHERE StockQty < StockReorderLevel
    and StockName NOT IN (Select stockName from ReorderTbl)

    OR
    If you indicate that Coke was reordered eg for Coke StockWasReOrdered = True then something like

    SELECT Stockname from StockTable
    Where StockQty <StockReorderLevel
    And StockWasReOrdered = False


    Once you reorder Coke, you have to do something to show that (many options for this I'm sure) and then your query has to use that info to bypass reorder of Coke.
    Good luck.

  3. #3
    xtrareal22 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2013
    Posts
    27
    Okay so i created a query that checks and displays what has not been ordered.So on my reorder table,I have the reorder iD ,the stock ID which is a combo box whose values come from a query that shows the name of items to reorder to select from.when something is ordered and i click on a save button a dialog form opens to tell that the item has been ordered and i click okay.When i click OK i want the underlying row source query for the stock id field to change to the values from the items not ordered query.How can i do that?Is possible?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848

  5. #5
    xtrareal22 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2013
    Posts
    27
    Click image for larger version. 

Name:	QueryScreenShot.png 
Views:	10 
Size:	133.0 KB 
ID:	14695
    I tried this query called item(s) not reordered.So like for an example coke and Pepsi are running low and not have been reordered,this two items dont show up in the query.But after i order coke first Pepsi is shown as not reordered in the query.What i want to do is for this query to show me those two item(s) have to be ordered before any of them is selected for reordering?

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    ???? In #4
    Did you look at my response for some options?
    https://www.accessforums.net/forms/su...index2.html#17
    I gave a structure to show the concept involved. I don't know where you query fits. Did you adjust you table structure?
    Can you post a copy of your database?

  7. #7
    xtrareal22 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2013
    Posts
    27
    i did something else and it works okay.Thank you for your time!!

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

Similar Threads

  1. Replies: 1
    Last Post: 08-03-2013, 10:41 AM
  2. Delete name typed in combo box
    By rzw0wr in forum Programming
    Replies: 3
    Last Post: 06-22-2013, 08:54 AM
  3. Replies: 11
    Last Post: 06-05-2013, 08:15 AM
  4. Replies: 2
    Last Post: 01-24-2012, 02:16 PM
  5. Trying to Delete record using delete query
    By MooseOTL in forum Access
    Replies: 13
    Last Post: 10-04-2011, 02:30 AM

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