By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,647 Members | 1,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,647 IT Pros & Developers. It's quick & easy.

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

100+
P: 135
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
Share this Question
Share on Google+
3 Replies


DonRayner
Expert 100+
P: 489
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

100+
P: 135
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

P: 52
--------------------------------------------------------------------------------

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.