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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Failed to refer to a form name 1

Status
Not open for further replies.

TTThio

Programmer
May 3, 2001
185
US
Hi folks,

I'm having some problem here in which, I tried to DSum the underlying query through criteria set in the subform, but it keeps giving me a message that the database cannot find the specified subform. I check the name couple times and it's been correct.

Here's my code:

varTotal= DSum(&quot;Price&quot;, &quot;qryOrder&quot;,&quot;[Order Date]<= # &quot; & Forms![OrderSubform]![Order Date] & &quot; #&quot;)

If I use me.[order date] instead of the full name of the subform as above, it says the object doesn't contain automation.

Can anybody help me with this?

Thanks ahead,
Tin Tin
 
Try this instead:
\[tt]
varTotal= DSum(&quot;[Price]&quot;, &quot;qryOrder&quot;,&quot;[Order Date]<= # &quot; & Forms![MainFormName]![OrderSubform].Form![Order Date] & &quot; #&quot;)
[/tt]

HTH Joe Miller
joe.miller@flotech.net
 
Write me.order_date or me![order date]

Aivars

varTotal= DSum(&quot;Price&quot;, &quot;qryOrder&quot;,&quot;[Order Date]<= # &quot; & Forms![OrderSubform]![Order Date] & &quot;#&quot;)
 
Thanks guys.

Aviars' first suggestion is applicable inside the code and make it able to work:

varTotal= DSum(&quot;Price&quot;, &quot;qryOrder&quot;,&quot;[Order Date]<= # &quot; & me.Order_Date & &quot; #&quot;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top