all items

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • goldstar
    New Member
    • Jan 2008
    • 49

    all items

    Hello All,

    Just got a quick query well im hoping it is a quick one!

    What i am trying to do is update records with an item table when it is removed. At the moment what is happening is if i have say 10 items and the remove button is pressed it is deleting all the records within that hire , which is fine, I can also get it to update the first item within the listbox. But it does update the other items that were within the listbox.
    I know what the problem is, this is what i am using. The findfirst is only finding the first item within the listbox that matches the item table. Is there a way for it to retrieve all the items that are removed? Hope it makes sense
    Code:
    Set rsitemline= currentdatabase.OpenRecordset("select * from itemhire Where itemno =" & Forms!frmitemhire!txtorderno)
            
    Set rsirtem= currentdatabase.OpenRecordset("tblitem")
            
    rsirtem.FindFirst ("[itemno]='" & rsitemline("itemno") & "'")
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #2
    Originally posted by goldstar
    ...
    Hope it makes sense
    ...
    Not remotely I'm afraid :(
    If you try to explain what you mean, by using terms that have no meaning except to you and your project, how can we follow you?

    Please try posting this again (in here - assume the first post is not there) but pay particular attention to the logic of someone reading it.

    Comment

    • goldstar
      New Member
      • Jan 2008
      • 49

      #3
      Ok,

      I currently have a system which allows hiring of items. When an item is selected this is displayed within a listbox and saved within a table. If i was to press remove then this would clear the listbox, delete from the table and update the hired item within the item table.

      Currenttly say i placed an hire order for 10 items, these would all display within a listbox, then if the remove button was to be pressed, all the items would be deleted from the table hireline. This works fine, but at the same time i want to update the stock within the item table. Currently the first item within the listbox updates within the item table but the remanining items do not update.

      The code displayed is the code that i am using. Hope this is more clear..
      Code:
      Set rsitemline= currentdatabase.OpenRecordset("select * from itemhire Where itemno =" & Forms!frmitemhire!txtorderno)
              
      Set rsirtem= currentdatabase.OpenRecordset("tblitem")
              
      rsirtem.FindFirst ("[itemno]='" & rsitemline("itemno") & "'")

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #4
        You should try reading this and seeing if you can make sense of it.
        Nothing is referred. Everything expects the reader to be already aware of the system before they can make sense of it.

        Do you not understand that it is your responsibility to make the question readable.

        Much as I'd like to, I simply cannot help if I can't understand what you're trying to say.

        Comment

        • goldstar
          New Member
          • Jan 2008
          • 49

          #5
          sorry but my english is not as good....

          lets try again.

          I have an item table, hire table and item hire table

          When an order is placed, the client will select the item and the quantity they require. When selected ok this will display that item within a listbox and into the itemhire table. The quantity they have selected would be decremented from the item table.
          If the client then selects another item then the same procedure takes place.

          If after say 6 items being ordered they decide to cancel the hire, the delete button would be pressed, this would remove all the items for this order from the itemhire table and update the quantity in the item table.

          I can currently get the items to be deleted from the itemhire table that are refereced to this order but cannot get the quantity for the items to be updated within the item table.

          Thanks

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32633

            #6
            Let's see if we can work with this.

            I presume you're talking about managing these updates with a form of some kind.
            How is the form laid out? Does it use subforms? Does the same form manage adding items as well as removing them - or is this done using a separate form?

            What code do you have already on you form for use with adding the items? That may be useful as the reverse is often similar to the original with some changes. We needn't reinvent the wheel if we don't have to.

            Comment

            Working...