Question

  • Thread starter Thread starter SteveC
  • Start date Start date
S

SteveC

I have a subform that I use on two separate forms. There is a field on the
form that shows the total costs for accessories. Here is the syntax for the
field:
=IIf(IsNull([LocationID]),0,DSum("[Cost]","Accessories","[LocationID]=" &
[LocationID]))

On the first form, Computers, this works just fine and shows the total
accessories for all the printers and monitors, etc. for that location.

On the second form, Locations, it also works fine when I first put it in;
however, when I close the form and come back to it, I get #Name? instead of
the expected dollar amount.

LocationID is key field on Locations and ComputerID is the key field on
Computers; however LocationID is related from Location Form to Computer
Form.

Any suggestions? Thanks.
 
It would appear that you have identical names for your bound field and
related form control. Try using Me!LocationID to refer to the name of the
control (or rename it/them to something like txtLocationID.

-Ed
 
Back
Top