Subform/Main Form ?Name# error

Lissa

Registered User.
Local time
Today, 08:02
Joined
Apr 27, 2007
Messages
114
I have a subform with the following 2 fields in the footer:

sumJan = Sum([January])
JanUtilPcnt =[sumJanuary]/DLookUp("January","BILLABLE_HRS","Year = " & Forms!sbfPlannedForecastData!Year)

These work fine in the subform but when I added the subform to a main form, I keep getting the #name? error for the JanUtilPcnt field.

I found some examples that recommended hiding the summary fields in the footer and then just referencing them by adding additional text boxes on the main form but I keep getting the #name? error for the second field that contains the DLookup.

This works...
JanSummary=
sbfPlannedForecastedData.Form!sumJanuary

This doesn't work...
JanUtilPercent=
sbfPlannedForecastedData.Form!JanUtilPcnt


Any hints on how to correct this?
Thanks!
 
Hello Lissa!
Send a short example of your mdb.
 
Also, replace Form! with Form.
 
short Example

Hello MStef & Bob...

I've attached a short example of my database.
I tried changing Forms! to Forms. but that didn't work either....

Thanks,
Lissa
 

Attachments

On your subform the source for JanUtilPcnt should be
[sumJanuary]/DLookUp("January","BILLABLE_HRS","Year = " & Year)

On your main form the source for JanUtilPercent should be[sbfPlannedForecastedData].Form!JanUtilPcnt

Try using the Expression builder to create your form/subform references while in design view.
 
Wow -it's working now! Thank you Craig
:)
 

Users who are viewing this thread

Back
Top Bottom