Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2008
    Posts
    5

    Unanswered: Updating a field

    Hi,

    I wasn't quite sure what to call the topic as I am not really sure what it is I am looking for.

    I have an Item table. This contains a field called ItemsRemaining.

    I have a form where customers select an item name from the item table. The customer can only select one item.

    So what I need to do is update the ItemsRemaining field by -1 when the member selects that item from the dropdown.combo box on the form.

    I have looked into update queries but I can only update every single Item's quantity by -1 and not a specific item a customer chooses.

    Thanks for any help.

    Benn.

  2. #2
    Join Date
    Dec 2004
    Location
    Connecticut
    Posts
    85
    You can set criteria in an update query.

    Add the item_number (or whatever you've called it) and items_remaining fields to the update query and set the criterion for item_number to equal the control value from the form (i.e., [MyForm].[ControlName]). Leave the "Update To" section blank for this field and only the items_remaining field will be updated.

    As long as the form is open, the query will work

  3. #3
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    This raises the issue of whether the value should be saved in the first place. There's a good discussion here:

    http://allenbrowne.com/AppInventory.html
    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •