change multiple records (1 Viewer)

jwal

Registered User.
Local time
Today, 15:42
Joined
Dec 1, 2015
Messages
13
Hi. I'm setting up a database to track company owned tools. I've created a split form with a filter based on a query that shows the complete inventory. What I'd like to do is after the filter has been completed, use check boxes to "select" multiple items from the inventory, then click a command button to "reassign" those items to a different employee. The command button would generate a pop-up. The pop-up would show the items that had been selected with the check boxes, a Combobox with the list of personnel and a command button to update the inventory table with the new assignee. What would the best way to set this up? Thanks in advance.
 

sneuberg

AWF VIP
Local time
Today, 12:42
Joined
Oct 17, 2014
Messages
3,506
If an inventory item is only assigned to one employees at a time then you could add a Yes/No field, let's say Assign, and a employee Id field to the inventory table. Let call that EmpID for this discussion. The record set for the pop up would be the inventory table items filter by the yes/no field. The combo box on the pop up, let's call it cboEmp would be unbounded with a row source of the employee table with the bound column set to the employee id. The command button on the pop would execute an update statements something like:
Code:
CurrentDb.Execute "UPDATE [name of inventory table] SET [EmpID] = " & cboEmp & " WHERE ASSIGN = True", dbFailOnError
CurrentDb.Execute "UPDATE [name of inventory table] SET ASSIGN = FALSE", dbFailOnError  'Reset the Yes/No check boxes
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:42
Joined
Jan 23, 2006
Messages
15,379
Just curious -- how do you identify individual tools?

Do you want to know that Bob has a hammer, or Bob has hammer Id 23?
Perhaps some samples of your data would be helpful to readers.

Your application generally sounds very much like a library system.

Client X borrows Tool Y on Day W===expected return on Day W +3 weeks...
 

jwal

Registered User.
Local time
Today, 15:42
Joined
Dec 1, 2015
Messages
13
Thanks. I can't figure out how to get the filter results to show up in the pop up.
 

sneuberg

AWF VIP
Local time
Today, 12:42
Joined
Oct 17, 2014
Messages
3,506
Just make a query for the record source of the Pop up that has the criteria of the Yes/No field (what I called Assign) set to True.
 

jwal

Registered User.
Local time
Today, 15:42
Joined
Dec 1, 2015
Messages
13
Very similar I would imagine. Tools are identified by ID number, category, and description. I've enabled the filter to search by either tool ID number, too description OR tool location (employee who has been assigned the tool, storage or junk/lost)
 

Users who are viewing this thread

Top Bottom