Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table update with count from another table

Status
Not open for further replies.

des0906

IS-IT--Management
Jul 30, 2001
69
US
Greetings. This problem is a bit more involved so I will lay it out in full:

I have two tables:

Table: InventoryTypes
Field: ID, txtType, txtModel, txtStockCount,
txtCurrentInventoryCount
Description: List of inventory equipment types and
associated info

Table: Inventory
Field: ID, txtAssign, comboType, comboModel, txtSerialNo
Description: Association between the txtAssign value and
type and model information.

Problem:

Each InventoryType can be used multiple times in the Inventory table. The Inventory.Assignment value is a phone extension in this case. I need to update the InventoryTypes.CurrentInventoryType value with a count of those type and model combinations in the Inventory table.

Any thoughts on how I can accomplish this?

Thanks.
 
Actually, I re-thought my approach and I am trying this. I reset the frmInventoryTypes.CurrentInventoryUsed.Value = DLookup("[Assignment]", "Inventory", "[ItemType] = '" & Me.InventoryType.Value & "'AND [Model] = '" & Me.InventoryModels.Value & "'")

I am currently doing this on an AfterUpdate event for the InventoryTypes.txtStockCount field, but can I run this in the form on_load event?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top