Run-Time error 2450

gizmogeek

Registered User.
Local time
Today, 18:56
Joined
Oct 3, 2007
Messages
95
Trying to get a total on main form from records from two subforms.

I'm coming up with Run-Time error 2450 Microsoft Access cannot find the referenced form 'tblitemlist subform'.
 
Last edited:
You need to reference the subform CONTROL name (name of the control on the parent form which houses/displays the subform) and not the name of the subform itself. Now, using the Builder, you can get the name you need by using this method here:
http://www.btabdevelopment.com/ts/refer2sfrms
 
I went back and read through the link a few times and I think I get it. I may have to do it ten times and that wasn't what I was worried about. I thought I had to put all ten times into the control name. I now believe that I had to go in and just check on the control source name and replace my code source objects with that.

So if that is correct and my old code looks like:
(Val(Nz(Forms![tblItemList subform]![PricePerUnit], 0))

Then do I drop the first Forms! after the (Val(Nz(Forms if my new code looks like:
(Val(Nz(Forms![tblItemList subform1].Form![PricePerUnit], 0))
 
I now get a total! Thanks Boblarson.

Could I update the "Total" text box with the use of a button? Just curious as to how I could/can do this differently. I did run through the button wizard but going to try to program it myself instead. I have no problems with the way it is now but would like to try it with a button too.
 

Users who are viewing this thread

Back
Top Bottom