#Name? Error With Subforms

pangono

Bored out of my brain
Local time
Today, 19:05
Joined
Mar 16, 2007
Messages
10
Ok, having problems with a simple database I'm doing for a cafe.

I have a form Stock (listing details of stock items) with a subform StockSubform2 (listing inventory movements). In the Stock from it lists the current quantity, the unit price and total value at hand. It's in the quantity control where I am having a problem.

I have created fields in the subform to get the Max unit cost (txtMaxUnitCost) and Sum the total purchased (txtTotalPurchased), total sold (txtTotalSold) and wastage (txtTotalWastage).

To then calculate the current quantity I have used the expression: =StockSubform2.Form!txtTotalPurchsed - StockSubform2.Form!txtTotalSold - StockSubform2.Form!txtTotalWastage.

The relevant fields in the Inventory table are: UnitCost, UnitsPurchased, UnitsSold, Wastage.
 
probally best to fully qualify your subformName

Forms!myMainForm!MySubform!myControl
 
Tried it but still getting a #name? error.
 
Subform

probally best to fully qualify your subformName

Forms!myMainForm!MySubform!myControl

Try:
Forms!myMainForm!MySubform.Form!myControl

If that doesn't work try using the expression builder coz I faced this issue of renaming a subform and totally forgetting about its previous name. Access used to accept it most places with the new name. But that one reference got stuck onto the previous name.
HTH
 

Users who are viewing this thread

Back
Top Bottom