469,317 Members | 2,036 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,317 developers. It's quick & easy.

"You entered an expression that has invalid reference to the property Form/Report"

135 100+
I am trying to open my purchase orders form and go to the last record. In the on open command I do:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.GoToRecord , , acLast
Seems straight forward enough...but I keep getting this message "You entered an expression that has invalid reference to the property Form/Report" before the form opens. After I acknowledge the message the form opens and goes to the last record. How do I X the message.
Nov 26 '08 #1
3 10388
DonRayner
489 Expert 256MB
The form and thus the recordset has not been loaded during the on open event. You need to perform this task in the "On Load" event.
Nov 26 '08 #2
MyWaterloo
135 100+
Thanks, that did it. What's funny is, I have no problem running the DoCmd on open in a diff database. Anyway...your advice did the trick. Thanks.
Nov 26 '08 #3
--------------------------------------------------------------------------------

I was having the same problem when using 2 subforms in a form. Apparently if you call any form's functions before the form is loaded it will produce this error. The fix was moving the failed subform above the one calling the code.
The load order is subforms first, from top to bottom, followed by the parent form.
Jan 11 '11 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Mark Ingram | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.