dbTalk Databases Forums  

Strange & Intermittent Error

comp.databases.ms-access comp.databases.ms-access


Discuss Strange & Intermittent Error in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Prakash
 
Posts: n/a

Default Strange & Intermittent Error - 12-17-2009 , 11:29 AM






I have a form containing the following code in the Current Event.
However, sometimes (only sometimes) it throws up an error message on
the "If [LPO_Mst.LOCKED] = True Then" statement saying ... Method or
Data Member not found. Can anyone please tell me where I'm going
wrong ?


Private Sub Form_Current()
If Me.LPO_Cancelled = True Then
Me.Lbl_Cancelled.Visible = True
Else
Me.Lbl_Cancelled.Visible = False
End If


If [LPO_Mst.LOCKED] = True Then
Call DisableEdits
Call DisableSubform
Else
Call EnableEdits
Call EnableSubform
End If

End Sub


Thanks & Best Rgds,
Prakash.

Reply With Quote
  #2  
Old   
Prakash
 
Posts: n/a

Default Re: Strange & Intermittent Error - 12-17-2009 , 11:33 AM






On Dec 17, 8:29*pm, Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote:
Quote:
I have a form containing the following code in the Current Event.
However, sometimes (only sometimes) it throws up an error message on
the "If [LPO_Mst.LOCKED] = True Then" statement saying ... Method or
Data Member not found. Can anyone please tell me where I'm going
wrong ?

Private Sub Form_Current()
* * If Me.LPO_Cancelled = True Then
* * * * Me.Lbl_Cancelled.Visible = True
* * Else
* * * * Me.Lbl_Cancelled.Visible = False
* * End If

* * If [LPO_Mst.LOCKED] = True Then
* * * * Call DisableEdits
* * * * Call DisableSubform
* * Else
* * * * Call EnableEdits
* * * * Call EnableSubform
* * End If

End Sub

Thanks & Best Rgds,
Prakash.


My apologies ... the exact error message displayed is as follows:

Run-time error 2465
Al Salami - Financial Accounting System can't find the field '|'
referred to in your expression.


I'd appreciate any help possible.

Thanks & Best Rgds,
Prakash.

Reply With Quote
  #3  
Old   
Salad
 
Posts: n/a

Default Re: Strange & Intermittent Error - 12-17-2009 , 11:56 AM



Prakash wrote:
Quote:
On Dec 17, 8:29 pm, Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote:

I have a form containing the following code in the Current Event.
However, sometimes (only sometimes) it throws up an error message on
the "If [LPO_Mst.LOCKED] = True Then" statement saying ... Method or
Data Member not found. Can anyone please tell me where I'm going
wrong ?

Private Sub Form_Current()
If Me.LPO_Cancelled = True Then
Me.Lbl_Cancelled.Visible = True
Else
Me.Lbl_Cancelled.Visible = False
End If

If [LPO_Mst.LOCKED] = True Then
Call DisableEdits
Call DisableSubform
Else
Call EnableEdits
Call EnableSubform
End If

End Sub

Thanks & Best Rgds,
Prakash.




My apologies ... the exact error message displayed is as follows:

Run-time error 2465
Al Salami - Financial Accounting System can't find the field '|'
referred to in your expression.


I'd appreciate any help possible.

Thanks & Best Rgds,
Prakash.
You have
If Me.LPO_Cancelled = True
but later
If [LPO_Mst.LOCKED] = True Then

Is it possible the field's control source is LPO_Mst but the name
something like Text123? IOW, add Me. to the line. I don't know if
that'd make any difference but...throwing mud at wall hoping to stick.

It appears it doesn't know what the field name is as it gives you a '|'
instead. Maybe there's some corruption somewhere. What if you open the
current form, create a new form in design mode, hightlight the controls
in the current form and copy/paste them into the new form as well as the
code, and save the new form as the current form's name. Then compact
and compile the FE. Or with the current form delete LPO_Mst and then
create a new control for it and make sure the event is associated with
the new control.

Reply With Quote
  #4  
Old   
Prakash
 
Posts: n/a

Default Re: Strange & Intermittent Error - 12-17-2009 , 03:40 PM



On Dec 17, 8:56*pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Quote:
Prakash wrote:
On Dec 17, 8:29 pm, Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote:

I have a form containing the following code in the Current Event.
However, sometimes (only sometimes) it throws up an error message on
the "If [LPO_Mst.LOCKED] = True Then" statement saying ... Method or
Data Member not found. Can anyone please tell me where I'm going
wrong ?

Private Sub Form_Current()
* *If Me.LPO_Cancelled = True Then
* * * *Me.Lbl_Cancelled.Visible = True
* *Else
* * * *Me.Lbl_Cancelled.Visible = False
* *End If

* *If [LPO_Mst.LOCKED] = True Then
* * * *Call DisableEdits
* * * *Call DisableSubform
* *Else
* * * *Call EnableEdits
* * * *Call EnableSubform
* *End If

End Sub

Thanks & Best Rgds,
Prakash.

My apologies ... the exact error message displayed is as follows:

Run-time error 2465
Al Salami - Financial Accounting System can't find the field '|'
referred to in your expression.

I'd appreciate any help possible.

Thanks & Best Rgds,
Prakash.

You have
* * * * If Me.LPO_Cancelled = True
but later
* * * * If [LPO_Mst.LOCKED] = True Then

Is it possible the field's control source is LPO_Mst but the name
something like Text123? *IOW, add Me. to the line. *I don't know if
that'd make any difference but...throwing mud at wall hoping to stick.

It appears it doesn't know what the field name is as it gives you a '|'
instead. *Maybe there's some corruption somewhere. *What if you open the
current form, create a new form in design mode, hightlight the controls
in the current form and copy/paste them into the new form as well as the
code, and save the new form as the current form's name. *Then compact
and compile the FE. *Or with the current form delete LPO_Mst and then
create a new control for it and make sure the event is associated with
the new control.
Actually, Me.LPO_Cancelled could be used because "Me.LPO_Cancelled" is
a control on the form. Now although the form is bound to a table, the
field "LOCKED" has not been used on the form in any control and so I
have to refer to the field by using the table name ... Hence: If
[LPO_Mst.LOCKED] = True has been used by me. If I'm wrong here, please
correct me.

Next, I did try to compact/repair a couple of times but that too did
not work.

In light of the options mentioned by you, I'd like to add that the
table bound to this form & subform was in the Front End. I imported
the 2 tables into the Back-End & deleted these 2 tables from the front
end. The problem started after this.

Probably with your experience you can point out where I've gone wrong.
Maybe I should reset the recordsource for the form/subform manually
now that it's been moved from the front end to the back end ?

Would love some input on this.

Thx & Best Rgds,
Prakash.

Reply With Quote
  #5  
Old   
Salad
 
Posts: n/a

Default Re: Strange & Intermittent Error - 12-17-2009 , 04:15 PM



Prakash wrote:

Quote:
On Dec 17, 8:56 pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

Prakash wrote:

On Dec 17, 8:29 pm, Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote:

I have a form containing the following code in the Current Event.
However, sometimes (only sometimes) it throws up an error message on
the "If [LPO_Mst.LOCKED] = True Then" statement saying ... Method or
Data Member not found. Can anyone please tell me where I'm going
wrong ?

Private Sub Form_Current()
If Me.LPO_Cancelled = True Then
Me.Lbl_Cancelled.Visible = True
Else
Me.Lbl_Cancelled.Visible = False
End If

If [LPO_Mst.LOCKED] = True Then
Call DisableEdits
Call DisableSubform
Else
Call EnableEdits
Call EnableSubform
End If

End Sub

Thanks & Best Rgds,
Prakash.

My apologies ... the exact error message displayed is as follows:

Run-time error 2465
Al Salami - Financial Accounting System can't find the field '|'
referred to in your expression.

I'd appreciate any help possible.

Thanks & Best Rgds,
Prakash.

You have
If Me.LPO_Cancelled = True
but later
If [LPO_Mst.LOCKED] = True Then

Is it possible the field's control source is LPO_Mst but the name
something like Text123? IOW, add Me. to the line. I don't know if
that'd make any difference but...throwing mud at wall hoping to stick.

It appears it doesn't know what the field name is as it gives you a '|'
instead. Maybe there's some corruption somewhere. What if you open the
current form, create a new form in design mode, hightlight the controls
in the current form and copy/paste them into the new form as well as the
code, and save the new form as the current form's name. Then compact
and compile the FE. Or with the current form delete LPO_Mst and then
create a new control for it and make sure the event is associated with
the new control.


Actually, Me.LPO_Cancelled could be used because "Me.LPO_Cancelled" is
a control on the form. Now although the form is bound to a table, the
field "LOCKED" has not been used on the form in any control and so I
have to refer to the field by using the table name ... Hence: If
[LPO_Mst.LOCKED] = True has been used by me. If I'm wrong here, please
correct me.
I don't know. Locked is a property. Just like Enabled is a property.
I thought you were referring to a property, not a field. Maybe it's
true and it workks and false and it doesn't. Maybe [Locked] instead of
no backets?

Maybe put the word Stop in the code to step thru the code.
STOP
If [LPO_Mst.LOCKED] = True Then

Quote:
Next, I did try to compact/repair a couple of times but that too did
not work.

In light of the options mentioned by you, I'd like to add that the
table bound to this form & subform was in the Front End. I imported
the 2 tables into the Back-End & deleted these 2 tables from the front
end. The problem started after this.

Probably with your experience you can point out where I've gone wrong.
I can only guess. Throw mud at the problem.

Quote:
Maybe I should reset the recordsource for the form/subform manually
now that it's been moved from the front end to the back end ?

I often use Msgbox to see the value of something. Maybe in the
OnCurrent event. Like
msgbox "Locked is " & Locked

Quote:
Would love some input on this.

Thx & Best Rgds,
Prakash.



Reply With Quote
  #6  
Old   
Bob Quintal
 
Posts: n/a

Default Re: Strange & Intermittent Error - 12-17-2009 , 05:11 PM



Prakash <prakashwadhwani (AT) gmail (DOT) com> wrote in
news:cd3345a3-81f9-4421-88bf-f635e165001e (AT) 33g2000vbe (DOT) googlegroups.com
:

Quote:
On Dec 17, 8:56*pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Prakash wrote:
On Dec 17, 8:29 pm, Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote:

I have a form containing the following code in the Current
Event. However, sometimes (only sometimes) it throws up an
error message on the "If [LPO_Mst.LOCKED] = True Then"
statement saying ... Method or Data Member not found. Can
anyone please tell me where I'm going wrong ?

Private Sub Form_Current()
* *If Me.LPO_Cancelled = True Then
* * * *Me.Lbl_Cancelled.Visible = True
* *Else
* * * *Me.Lbl_Cancelled.Visible = False
* *End If

* *If [LPO_Mst.LOCKED] = True Then
* * * *Call DisableEdits
* * * *Call DisableSubform
* *Else
* * * *Call EnableEdits
* * * *Call EnableSubform
* *End If

End Sub

Thanks & Best Rgds,
Prakash.

My apologies ... the exact error message displayed is as
follows:

Run-time error 2465
Al Salami - Financial Accounting System can't find the field
'|' referred to in your expression.

I'd appreciate any help possible.

Thanks & Best Rgds,
Prakash.

You have
* * * * If Me.LPO_Cancelled = True
but later
* * * * If [LPO_Mst.LOCKED] = True Then

Is it possible the field's control source is LPO_Mst but the name
something like Text123? *IOW, add Me. to the line. *I don't know
if that'd make any difference but...throwing mud at wall hoping
to stick.

It appears it doesn't know what the field name is as it gives you
a '|' instead. *Maybe there's some corruption somewhere. *What if
you open
the
current form, create a new form in design mode, hightlight the
controls in the current form and copy/paste them into the new
form as well as the code, and save the new form as the current
form's name. *Then compact and compile the FE. *Or with the
current form delete LPO_Mst and then create a new control for it
and make sure the event is associated with the new control.

Actually, Me.LPO_Cancelled could be used because
"Me.LPO_Cancelled" is a control on the form. Now although the form
is bound to a table, the field "LOCKED" has not been used on the
form in any control and so I have to refer to the field by using
the table name ... Hence: If [LPO_Mst.LOCKED] = True has been used
by me. If I'm wrong here, please correct me.

refer to the field as follows and see if it helps
[LPO_Mst].[LOCKED]




Quote:
Next, I did try to compact/repair a couple of times but that too
did not work.

In light of the options mentioned by you, I'd like to add that the
table bound to this form & subform was in the Front End. I
imported the 2 tables into the Back-End & deleted these 2 tables
from the front end. The problem started after this.

Probably with your experience you can point out where I've gone
wrong. Maybe I should reset the recordsource for the form/subform
manually now that it's been moved from the front end to the back
end ?

Would love some input on this.

Thx & Best Rgds,
Prakash.





--
Bob Quintal

PA is y I've altered my email address.

Reply With Quote
  #7  
Old   
Prakash
 
Posts: n/a

Default Re: Strange & Intermittent Error - 12-20-2009 , 01:31 AM



On Dec 18, 2:11*am, Bob Quintal <rquin... (AT) sPAmpatico (DOT) ca> wrote:
Quote:
Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote innews:cd3345a3-81f9-4421-88bf-f635e165001e (AT) 33g2000vbe (DOT) googlegroups.com
:



On Dec 17, 8:56*pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Prakash wrote:
On Dec 17, 8:29 pm, Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote:

I have a form containing the following code in the Current
Event. However, sometimes (only sometimes) it throws up an
error message on the "If [LPO_Mst.LOCKED] = True Then"
statement saying ... Method or Data Member not found. Can
anyone please tell me where I'm going wrong ?

Private Sub Form_Current()
* *If Me.LPO_Cancelled = True Then
* * * *Me.Lbl_Cancelled.Visible = True
* *Else
* * * *Me.Lbl_Cancelled.Visible = False
* *End If

* *If [LPO_Mst.LOCKED] = True Then
* * * *Call DisableEdits
* * * *Call DisableSubform
* *Else
* * * *Call EnableEdits
* * * *Call EnableSubform
* *End If

End Sub

Thanks & Best Rgds,
Prakash.

My apologies ... the exact error message displayed is as
follows:

Run-time error 2465
Al Salami - Financial Accounting System can't find the field
'|' referred to in your expression.

I'd appreciate any help possible.

Thanks & Best Rgds,
Prakash.

You have
* * * * If Me.LPO_Cancelled = True
but later
* * * * If [LPO_Mst.LOCKED] = True Then

Is it possible the field's control source is LPO_Mst but the name
something like Text123? *IOW, add Me. to the line. *I don't know
if that'd make any difference but...throwing mud at wall hoping
to stick.

It appears it doesn't know what the field name is as it gives you
a '|' instead. *Maybe there's some corruption somewhere. *What if
you open
the
current form, create a new form in design mode, hightlight the
controls in the current form and copy/paste them into the new
form as well as the code, and save the new form as the current
form's name. *Then compact and compile the FE. *Or with the
current form delete LPO_Mst and then create a new control for it
and make sure the event is associated with the new control.

Actually, Me.LPO_Cancelled could be used because
"Me.LPO_Cancelled" is a control on the form. Now although the form
is bound to a table, the field "LOCKED" has not been used on the
form in any control and so I have to refer to the field by using
the table name ... Hence: If [LPO_Mst.LOCKED] = True has been used
by me. If I'm wrong here, please correct me.

refer to the field as follows and see if it helps
[LPO_Mst].[LOCKED]



Next, I did try to compact/repair a couple of times but that too
did not work.

In light of the options mentioned by you, I'd like to add that the
table bound to this form & subform was in the Front End. I
imported the 2 tables into the Back-End & deleted these 2 tables
from the front end. The problem started after this.

Probably with your experience you can point out where I've gone
wrong. Maybe I should reset the recordsource for the form/subform
manually now that it's been moved from the front end to the back
end ?

Would love some input on this.

Thx & Best Rgds,
Prakash.

--
Bob Quintal

PA is y I've altered my email address.

Sorry Bob ... did try that too like you advised but it didn't work.
The error kept coming up randomly from time to time. Just couldn't
pinpoint the reason and replicate it at will.

I finally tried If Me.Locked = True and it seems to have worked.
At least the error has not come up during the past 2 days. Still
holding my breath. Please note that "locked" is a field in the table
(which is bound to the form) ... but this "locked" field is not
present as a text box or control on the form.

Many thanks to you and Salad for your kind help and if the problem
resurfaces, I'll be sure to drop a line here.

Best Rgds,
Prakash.

Reply With Quote
  #8  
Old   
Roger
 
Posts: n/a

Default Re: Strange & Intermittent Error - 12-20-2009 , 07:13 AM



On Dec 19, 11:31*pm, Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote:
Quote:
On Dec 18, 2:11*am, Bob Quintal <rquin... (AT) sPAmpatico (DOT) ca> wrote:





Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote innews:cd3345a3-81f9-4421-88bf-f635e165001e (AT) 33g2000vbe (DOT) googlegroups.com
:

On Dec 17, 8:56*pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Prakash wrote:
On Dec 17, 8:29 pm, Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote:

I have a form containing the following code in the Current
Event. However, sometimes (only sometimes) it throws up an
error message on the "If [LPO_Mst.LOCKED] = True Then"
statement saying ... Method or Data Member not found. Can
anyone please tell me where I'm going wrong ?

Private Sub Form_Current()
* *If Me.LPO_Cancelled = True Then
* * * *Me.Lbl_Cancelled.Visible = True
* *Else
* * * *Me.Lbl_Cancelled.Visible = False
* *End If

* *If [LPO_Mst.LOCKED] = True Then
* * * *Call DisableEdits
* * * *Call DisableSubform
* *Else
* * * *Call EnableEdits
* * * *Call EnableSubform
* *End If

End Sub

Thanks & Best Rgds,
Prakash.

My apologies ... the exact error message displayed is as
follows:

Run-time error 2465
Al Salami - Financial Accounting System can't find the field
'|' referred to in your expression.

I'd appreciate any help possible.

Thanks & Best Rgds,
Prakash.

You have
* * * * If Me.LPO_Cancelled = True
but later
* * * * If [LPO_Mst.LOCKED] = True Then

Is it possible the field's control source is LPO_Mst but the name
something like Text123? *IOW, add Me. to the line. *I don't know
if that'd make any difference but...throwing mud at wall hoping
to stick.

It appears it doesn't know what the field name is as it gives you
a '|' instead. *Maybe there's some corruption somewhere. *What if
you open
the
current form, create a new form in design mode, hightlight the
controls in the current form and copy/paste them into the new
form as well as the code, and save the new form as the current
form's name. *Then compact and compile the FE. *Or with the
current form delete LPO_Mst and then create a new control for it
and make sure the event is associated with the new control.

Actually, Me.LPO_Cancelled could be used because
"Me.LPO_Cancelled" is a control on the form. Now although the form
is bound to a table, the field "LOCKED" has not been used on the
form in any control and so I have to refer to the field by using
the table name ... Hence: If [LPO_Mst.LOCKED] = True has been used
by me. If I'm wrong here, please correct me.

refer to the field as follows and see if it helps
[LPO_Mst].[LOCKED]

Next, I did try to compact/repair a couple of times but that too
did not work.

In light of the options mentioned by you, I'd like to add that the
table bound to this form & subform was in the Front End. I
imported the 2 tables into the Back-End & deleted these 2 tables
from the front end. The problem started after this.

Probably with your experience you can point out where I've gone
wrong. Maybe I should reset the recordsource for the form/subform
manually now that it's been moved from the front end to the back
end ?

Would love some input on this.

Thx & Best Rgds,
Prakash.

--
Bob Quintal

PA is y I've altered my email address.

Sorry Bob ... did try that too like you advised but it didn't work.
The error kept coming up randomly from time to time. Just couldn't
pinpoint the reason and replicate it at will.

I finally tried * If Me.Locked = True * and it seems to have worked..
At least the error has not come up during the past 2 days. Still
holding my breath. Please note that "locked" is a field in the table
(which is bound to the form) ... but this "locked" field is not
present as a text box or control on the form.

Many thanks to you and Salad for your kind help and if the problem
resurfaces, I'll be sure to drop a line here.

Best Rgds,
Prakash.- Hide quoted text -

- Show quoted text -
would it not be easier to put an invisible control on the form bound
to this 'locked' field ?

Reply With Quote
  #9  
Old   
Prakash
 
Posts: n/a

Default Re: Strange & Intermittent Error - 12-20-2009 , 02:23 PM



On Dec 20, 4:13*pm, Roger <lesperan... (AT) natpro (DOT) com> wrote:
Quote:
On Dec 19, 11:31*pm, Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote:



On Dec 18, 2:11*am, Bob Quintal <rquin... (AT) sPAmpatico (DOT) ca> wrote:

Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote innews:cd3345a3-81f9-4421-88bf-f635e165001e (AT) 33g2000vbe (DOT) googlegroups.com
:

On Dec 17, 8:56*pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Prakash wrote:
On Dec 17, 8:29 pm, Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote:

I have a form containing the following code in the Current
Event. However, sometimes (only sometimes) it throws up an
error message on the "If [LPO_Mst.LOCKED] = True Then"
statement saying ... Method or Data Member not found. Can
anyone please tell me where I'm going wrong ?

Private Sub Form_Current()
* *If Me.LPO_Cancelled = True Then
* * * *Me.Lbl_Cancelled.Visible = True
* *Else
* * * *Me.Lbl_Cancelled.Visible = False
* *End If

* *If [LPO_Mst.LOCKED] = True Then
* * * *Call DisableEdits
* * * *Call DisableSubform
* *Else
* * * *Call EnableEdits
* * * *Call EnableSubform
* *End If

End Sub

Thanks & Best Rgds,
Prakash.

My apologies ... the exact error message displayed is as
follows:

Run-time error 2465
Al Salami - Financial Accounting System can't find the field
'|' referred to in your expression.

I'd appreciate any help possible.

Thanks & Best Rgds,
Prakash.

You have
* * * * If Me.LPO_Cancelled = True
but later
* * * * If [LPO_Mst.LOCKED] = True Then

Is it possible the field's control source is LPO_Mst but the name
something like Text123? *IOW, add Me. to the line. *I don't know
if that'd make any difference but...throwing mud at wall hoping
to stick.

It appears it doesn't know what the field name is as it gives you
a '|' instead. *Maybe there's some corruption somewhere. *Whatif
you open
the
current form, create a new form in design mode, hightlight the
controls in the current form and copy/paste them into the new
form as well as the code, and save the new form as the current
form's name. *Then compact and compile the FE. *Or with the
current form delete LPO_Mst and then create a new control for it
and make sure the event is associated with the new control.

Actually, Me.LPO_Cancelled could be used because
"Me.LPO_Cancelled" is a control on the form. Now although the form
is bound to a table, the field "LOCKED" has not been used on the
form in any control and so I have to refer to the field by using
the table name ... Hence: If [LPO_Mst.LOCKED] = True has been used
by me. If I'm wrong here, please correct me.

refer to the field as follows and see if it helps
[LPO_Mst].[LOCKED]

Next, I did try to compact/repair a couple of times but that too
did not work.

In light of the options mentioned by you, I'd like to add that the
table bound to this form & subform was in the Front End. I
imported the 2 tables into the Back-End & deleted these 2 tables
from the front end. The problem started after this.

Probably with your experience you can point out where I've gone
wrong. Maybe I should reset the recordsource for the form/subform
manually now that it's been moved from the front end to the back
end ?

Would love some input on this.

Thx & Best Rgds,
Prakash.

--
Bob Quintal

PA is y I've altered my email address.

Sorry Bob ... did try that too like you advised but it didn't work.
The error kept coming up randomly from time to time. Just couldn't
pinpoint the reason and replicate it at will.

I finally tried * If Me.Locked = True * and it seems to have worked.
At least the error has not come up during the past 2 days. Still
holding my breath. Please note that "locked" is a field in the table
(which is bound to the form) ... but this "locked" field is not
present as a text box or control on the form.

Many thanks to you and Salad for your kind help and if the problem
resurfaces, I'll be sure to drop a line here.

Best Rgds,
Prakash.- Hide quoted text -

- Show quoted text -

would it not be easier to put an invisible control on the form bound
to this 'locked' field ?
Yes Roger ... it did occur to me to do that ... however, I had left
that as a last resort if nothing else worked as I didn't want any
unnecessary controls on my form albeit invisible. Thank you very much
though for your suggestion as I will remember it for the future when
in a very tight corner or (hopefully not) ... if my form starts
playing up again.

Best Rgds,
Prakash.

Reply With Quote
  #10  
Old   
Salad
 
Posts: n/a

Default Re: Strange & Intermittent Error - 12-21-2009 , 11:34 AM



Prakash wrote:

Quote:
On Dec 18, 2:11 am, Bob Quintal <rquin... (AT) sPAmpatico (DOT) ca> wrote:

Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote innews:cd3345a3-81f9-4421-88bf-f635e165001e (AT) 33g2000vbe (DOT) googlegroups.com
:




On Dec 17, 8:56 pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

Prakash wrote:

On Dec 17, 8:29 pm, Prakash <prakashwadhw... (AT) gmail (DOT) com> wrote:

I have a form containing the following code in the Current
Event. However, sometimes (only sometimes) it throws up an
error message on the "If [LPO_Mst.LOCKED] = True Then"
statement saying ... Method or Data Member not found. Can
anyone please tell me where I'm going wrong ?

Private Sub Form_Current()
If Me.LPO_Cancelled = True Then
Me.Lbl_Cancelled.Visible = True
Else
Me.Lbl_Cancelled.Visible = False
End If

If [LPO_Mst.LOCKED] = True Then
Call DisableEdits
Call DisableSubform
Else
Call EnableEdits
Call EnableSubform
End If

End Sub

Thanks & Best Rgds,
Prakash.

My apologies ... the exact error message displayed is as
follows:

Run-time error 2465
Al Salami - Financial Accounting System can't find the field
'|' referred to in your expression.

I'd appreciate any help possible.

Thanks & Best Rgds,
Prakash.

You have
If Me.LPO_Cancelled = True
but later
If [LPO_Mst.LOCKED] = True Then

Is it possible the field's control source is LPO_Mst but the name
something like Text123? IOW, add Me. to the line. I don't know
if that'd make any difference but...throwing mud at wall hoping
to stick.

It appears it doesn't know what the field name is as it gives you
a '|' instead. Maybe there's some corruption somewhere. What if
you open

the

current form, create a new form in design mode, hightlight the
controls in the current form and copy/paste them into the new
form as well as the code, and save the new form as the current
form's name. Then compact and compile the FE. Or with the
current form delete LPO_Mst and then create a new control for it
and make sure the event is associated with the new control.

Actually, Me.LPO_Cancelled could be used because
"Me.LPO_Cancelled" is a control on the form. Now although the form
is bound to a table, the field "LOCKED" has not been used on the
form in any control and so I have to refer to the field by using
the table name ... Hence: If [LPO_Mst.LOCKED] = True has been used
by me. If I'm wrong here, please correct me.

refer to the field as follows and see if it helps
[LPO_Mst].[LOCKED]




Next, I did try to compact/repair a couple of times but that too
did not work.

In light of the options mentioned by you, I'd like to add that the
table bound to this form & subform was in the Front End. I
imported the 2 tables into the Back-End & deleted these 2 tables
from the front end. The problem started after this.

Probably with your experience you can point out where I've gone
wrong. Maybe I should reset the recordsource for the form/subform
manually now that it's been moved from the front end to the back
end ?

Would love some input on this.

Thx & Best Rgds,
Prakash.

--
Bob Quintal

PA is y I've altered my email address.



Sorry Bob ... did try that too like you advised but it didn't work.
The error kept coming up randomly from time to time. Just couldn't
pinpoint the reason and replicate it at will.

I finally tried If Me.Locked = True and it seems to have worked.
At least the error has not come up during the past 2 days. Still
holding my breath. Please note that "locked" is a field in the table
(which is bound to the form) ... but this "locked" field is not
present as a text box or control on the form.

Many thanks to you and Salad for your kind help and if the problem
resurfaces, I'll be sure to drop a line here.

Best Rgds,
Prakash.
Since "locked" is a property, as well as a field in your table, Access
might have been complaining about which to use then gave up in
frustration. By adding Me. to the code line, it was more explicit to
what you meant...at least in human reasoning.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.