473,397 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

On form open, expression has invalid reference

Hey there,

I just put the following code:

DoCmd.GoToRecord , , acLast

in the On Open event of my form, which has 2 subforms. The following
error message appears when the form now opens:

"You entered an expression that has an invalid reference to the
property Form/Report." But, after clicking the OK on the msgbox, the
form opens to the last record.

I've used this before without problems. Is this a simple fix?

Thanks much

Arnold
Nov 12 '05 #1
2 5339
Try putting it in the form's On Load event instead.
On Open fires before the data is loaded, so it doesn't know what the last
record is yet.

HTH
- Turtle
"Arnold" <ee*******@earthlink.net> wrote in message
news:18**************************@posting.google.c om...
Hey there,

I just put the following code:

DoCmd.GoToRecord , , acLast

in the On Open event of my form, which has 2 subforms. The following
error message appears when the form now opens:

"You entered an expression that has an invalid reference to the
property Form/Report." But, after clicking the OK on the msgbox, the
form opens to the last record.

I've used this before without problems. Is this a simple fix?

Thanks much

Arnold

Nov 12 '05 #2
"Arnold" <ee*******@earthlink.net> wrote in message
news:18**************************@posting.google.c om...
Hey there,

I just put the following code:

DoCmd.GoToRecord , , acLast

in the On Open event of my form, which has 2 subforms. The following
error message appears when the form now opens:

"You entered an expression that has an invalid reference to the
property Form/Report." But, after clicking the OK on the msgbox, the
form opens to the last record.

I've used this before without problems. Is this a simple fix?

Thanks much

Arnold

Are you absolutely sure the error message is coming from the main form's
open event? You can set a breakpoint to check this. Is that the complete
code you have, or do you use error handling? Have you made sure the code
all compiles?
In any case, if I wanted to go to the last record, I might use soemthing
like this:

With Me.RecordsetClone
.MoveLast
Me.Bookmark = .Bookmark
End With
Fletcher
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: Eli | last post by:
How can I POST a form into a new window where I control the size and other attributes of the new window? Also. Are there any implications, perhaps due to browser security (Interne Explorer?)...
3
by: Skippytpe | last post by:
Does anyone have an idea why the form validation in the following page wouldn't be working? I had been using XHTML 1.0 transitional which allowed me to use the form attribute 'name.' I could then...
4
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
0
by: John Hunter | last post by:
I've recently had a nasty problem with the "Invalid reference to the property Form" error in subforms - nasty because it doesn't seem to consistently happen to all forms which contain the same...
1
by: jcazmail-groups | last post by:
The following snippet gives me an error on the line regarding AllowAdditions = False: Private Sub EditLocked() txtDeliveryDate.Locked = True cmdDeliveryDate.Enabled = False...
8
by: | last post by:
hi, i have a form on which a user can choose specific criteria such as dates etc, in order to filter the report that is called from the form. i do this by using the Where section of the...
12
by: Rob | last post by:
Let's say you open Form1 that contains TabControl1 There are several tabs on TabControl1 Now you open a new Form2 that contains a User Control How can you determine the Selected tab in Form1...
3
by: MyWaterloo | last post by:
I am trying to open my purchase orders form and go to the last record. In the on open command I do: DoCmd.GoToRecord , , acLast Seems straight forward enough...but I keep getting this message...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.