Results 1 to 8 of 8
  1. #1
    xdeimusx is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Posts
    7

    Help with actions

    I have lending library template and I am trying to create a new action.I am unfamiliar how to create action and am in need of a little assistance.
    To give an example in this template when you check out a asset it assigns it to a contact. When you check the asset back in it puts it back in your inventory, however, it really never leaves your inventory. Now I am trying to create another button along side of that one if one of my employees installs the asset i want it to put the asset in a different place and take it out of inventory. I assume it goes like this. I have to create a table of the assets information i want transferred and a place to transfer to . create a table for the button to be linked to. create a form for the user to put what job the part was installed on. Click the button wham bam takes the asset out of inventory put it in another table that can be reported later. If this involves writing script for a filter of some sort i would need alot of help on that.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Don't recommend this. Instead of yo-yoing records, just toggle a Yes/No field to indicate status. Not understanding why you need this. Doesn't the db already do something to indicate asset availability status?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    xdeimusx is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Posts
    7
    Kinda. It will tell you the status, who and if it is checked out but never takes it out of the inventory. once the asset has been installed it needs to be transferred to a different table and be completely gone from inventory.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Still don't understand. The item is checked out but eventually returns, doesn't it? Even though it is checked out you still must account for the item, right? That means it is still part of your inventory. If all no, then maybe you should look at the Inventory template database.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    xdeimusx is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Posts
    7
    Say I own a vacuum business and i have 2 employees. Both are taking 1 vacuum out to go door to door ( check out 1 vacuum to each employee.). First employee comes back and did not sell the vacuum ( I check the vacuum back in to my inventory.). Second employee sells the vacuum and dosnt have anything to return. This is where i want to be able to transfer the inventory that was checked out to him to a new place. We will call that the sold table. How do i create a button to remove the vacuum from my inventory to a "sold Table" so at the end of the month i Know what i sold and what i still have. The Inventory DB Wont let me check inventory out to employees.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Code to copy/delete records would involve SQL action statements, like:

    DoCmd.SetWarnings = False
    DoCmd.RunSQL "INSERT INTO tablename ..."
    DoCmd.RunSQL "DELETE FROM tablename WHERE ID = " & some input value
    DoCmd.SetWarnings = True

    The INSERT action could be combined with a SELECT query. Check this tutorial http://www.sqlteam.com/article/using...insert-records.

    Alternatively, adapt db to handle this without moving records around. Either Inventory to allow checkout or Library to show status as 'sold' then a child table that would record the ID of sold item, price, date, salesperson, customer.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    xdeimusx is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2011
    Posts
    7
    Not going to lie but I have no idea where to input those values. Do I just ad them to the filter that is associated with that check in/check out process?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    By 'no idea where to input those values' do you mean the code I show? The code would have to go in an event, such as a button click. I use only VBA, not macros. I just remembered that the template is probably heavy on macro coding. I don't know if the check in/out process would be the best place for this.

    Instead of executing an SQL in VBA you could build an Access query object and save it. Then the VBA (I don't know what the macro equivalent would be) code would run the saved query object with: DoCmd.OpenQuery "query name"

    You would need to create the 'sold' table that would be the destination for the INSERT action.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Macro with 3 actions
    By seweryng in forum Access
    Replies: 4
    Last Post: 01-20-2011, 10:15 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