Error 2455 (invalid reference)

J

John J.

I have an app that is being used by 8 people. Only one of the users
sometimes gets the following error message, which happens randomly and can
not be forced:

"Error 2455 The expression contains an invalid reference to the property
Form/Report"

The error occurs when the user pushes a button that triggers locating a
record on another open form. This is the code behind the button. The
btnQS_Click on frmA does the actual locating.

Forms![frmA].[fldQS] =
Forms![frmGlobSearch]![subfrmGlobSearch].Form![ID_source]
Call Forms.frmA.btnQS_Click
Forms![frmA].SetFocus

Since the error can not be forced it's hard to troubleshoot.

Looking at the code does someone perhaps have an idea what causes the error
to occur and how to solve the error? Should I reference differently to the
forms?

Thanks for any input.
John
 
P

Pete D.

Your error appears to be the setfocus, try providing the complete reference
to the form/control
..
 
J

John J.

Thanks, but can you explain what you mean by "the complete reference
to the form/control"? Isn't Forms![frmA] the complete reference?

John

Pete D. said:
Your error appears to be the setfocus, try providing the complete
reference to the form/control
.
John J. said:
I have an app that is being used by 8 people. Only one of the users
sometimes gets the following error message, which happens randomly and can
not be forced:

"Error 2455 The expression contains an invalid reference to the property
Form/Report"

The error occurs when the user pushes a button that triggers locating a
record on another open form. This is the code behind the button. The
btnQS_Click on frmA does the actual locating.

Forms![frmA].[fldQS] =
Forms![frmGlobSearch]![subfrmGlobSearch].Form![ID_source]
Call Forms.frmA.btnQS_Click
Forms![frmA].SetFocus

Since the error can not be forced it's hard to troubleshoot.

Looking at the code does someone perhaps have an idea what causes the
error to occur and how to solve the error? Should I reference differently
to the forms?

Thanks for any input.
John
 
P

Pete D.

John J. said:
Thanks, but can you explain what you mean by "the complete reference
to the form/control"? Isn't Forms![frmA] the complete reference?

John

Pete D. said:
Your error appears to be the setfocus, try providing the complete
reference to the form/control
.
John J. said:
I have an app that is being used by 8 people. Only one of the users
sometimes gets the following error message, which happens randomly and
can not be forced:

"Error 2455 The expression contains an invalid reference to the property
Form/Report"

The error occurs when the user pushes a button that triggers locating a
record on another open form. This is the code behind the button. The
btnQS_Click on frmA does the actual locating.

Forms![frmA].[fldQS] =
Forms![frmGlobSearch]![subfrmGlobSearch].Form![ID_source]
Call Forms.frmA.btnQS_Click
Forms![frmA].SetFocus
It appears after you make your call to the function/sub that access doesn't
know what form control you are refering to. Look at below to see if this
helps your problem

Forms.Form1.subForm1.Form.Controls(strControlName) = "X"
 
J

John J.

Pete D. said:
Your error appears to be the setfocus, try providing the complete
reference to the form/control
.
I have an app that is being used by 8 people. Only one of the users
sometimes gets the following error message, which happens randomly and
can not be forced:

"Error 2455 The expression contains an invalid reference to the
property Form/Report"

The error occurs when the user pushes a button that triggers locating a
record on another open form. This is the code behind the button. The
btnQS_Click on frmA does the actual locating.

Forms![frmA].[fldQS] =
Forms![frmGlobSearch]![subfrmGlobSearch].Form![ID_source]
Call Forms.frmA.btnQS_Click
Forms![frmA].SetFocus
It appears after you make your call to the function/sub that access
doesn't know what form control you are refering to. Look at below to see
if this helps your problem

Forms.Form1.subForm1.Form.Controls(strControlName) = "X"

The focus needs to go to FrmA (it just brings the form on top) so I don't
see how can I use the referencing you describe in:
Forms![frmA].SetFocus

Or do you mean I should adjust:
<<Forms![frmA].[fldQS] = >>
and
<< Forms![frmGlobSearch]![subfrmGlobSearch].Form![ID_source]>>
the way you described (referecing using .Controls?

John
 
P

Pete D.

Hi,
For some reason Access cannot find the item you are trying to set focus to.
Now as you say it is only one person/system doing this I have to wonder if
something else is running that takes the access app away so it cannot set
focus when the event fires. Problem is you can't force the error but I
would start the system without anything else running and see if problem goes
away. Best you can do is see what is running that may interfer with it such
as autostart programs, apps user has idling that others don't. At this
point as you seem to really know what your doing this is my best guess.
Something prevents access from finding the form at the time it tries to set
focus.

John J. said:
"Pete D." <[email protected]> schreef in bericht
Your error appears to be the setfocus, try providing the complete
reference to the form/control
.
I have an app that is being used by 8 people. Only one of the users
sometimes gets the following error message, which happens randomly and
can not be forced:

"Error 2455 The expression contains an invalid reference to the
property Form/Report"

The error occurs when the user pushes a button that triggers locating
a record on another open form. This is the code behind the button. The
btnQS_Click on frmA does the actual locating.

Forms![frmA].[fldQS] =
Forms![frmGlobSearch]![subfrmGlobSearch].Form![ID_source]
Call Forms.frmA.btnQS_Click
Forms![frmA].SetFocus
It appears after you make your call to the function/sub that access
doesn't know what form control you are refering to. Look at below to see
if this helps your problem

Forms.Form1.subForm1.Form.Controls(strControlName) = "X"

The focus needs to go to FrmA (it just brings the form on top) so I don't
see how can I use the referencing you describe in:
Forms![frmA].SetFocus

Or do you mean I should adjust:
<<Forms![frmA].[fldQS] = >>
and
<< Forms![frmGlobSearch]![subfrmGlobSearch].Form![ID_source]>>
the way you described (referecing using .Controls?

John
 
J

John J.

Thanks again for your comments.
I'll do some more troubleshooting.

Pete D. said:
Hi,
For some reason Access cannot find the item you are trying to set focus
to. Now as you say it is only one person/system doing this I have to
wonder if something else is running that takes the access app away so it
cannot set focus when the event fires. Problem is you can't force the
error but I would start the system without anything else running and see
if problem goes away. Best you can do is see what is running that may
interfer with it such as autostart programs, apps user has idling that
others don't. At this point as you seem to really know what your doing
this is my best guess. Something prevents access from finding the form at
the time it tries to set focus.

John J. said:
"Pete D." <[email protected]> schreef in bericht
Your error appears to be the setfocus, try providing the complete
reference to the form/control
.
I have an app that is being used by 8 people. Only one of the users
sometimes gets the following error message, which happens randomly and
can not be forced:

"Error 2455 The expression contains an invalid reference to the
property Form/Report"

The error occurs when the user pushes a button that triggers locating
a record on another open form. This is the code behind the button.
The btnQS_Click on frmA does the actual locating.

Forms![frmA].[fldQS] =
Forms![frmGlobSearch]![subfrmGlobSearch].Form![ID_source]
Call Forms.frmA.btnQS_Click
Forms![frmA].SetFocus
It appears after you make your call to the function/sub that access
doesn't know what form control you are refering to. Look at below to
see if this helps your problem

Forms.Form1.subForm1.Form.Controls(strControlName) = "X"

The focus needs to go to FrmA (it just brings the form on top) so I don't
see how can I use the referencing you describe in:
Forms![frmA].SetFocus

Or do you mean I should adjust:
<<Forms![frmA].[fldQS] = >>
and
<< Forms![frmGlobSearch]![subfrmGlobSearch].Form![ID_source]>>
the way you described (referecing using .Controls?

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top