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
  #11  
Old   
Prakash
 
Posts: n/a

Default Re: Strange & Intermittent Error - 12-23-2009 , 01:00 AM






On Dec 21, 8:34*pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:
Quote:
Prakash 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. *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.
Thanks Salad! Probably what you explained makes sense. I did check
the list of reserved words & "Locked" was not on it. Nevertheless, I
guess mixing properties with filed names et al seems a daft idea (hit
me) and I'll definitely stay away from it. In hindsight, I feel I
could have changed the field name "locked" to "lpo_locked" just to
ensure Access doesn't hiccup on resolving the field name.

Lesson learned.

Rgds,
Prakash.

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

Default Re: Strange & Intermittent Error - 12-23-2009 , 01:58 AM






Prakash wrote:
Quote:
On Dec 21, 8:34 pm, Salad <sa... (AT) oilandvinegar (DOT) com> wrote:

Prakash 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. 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.


Thanks Salad! Probably what you explained makes sense. I did check
the list of reserved words & "Locked" was not on it. Nevertheless, I
guess mixing properties with filed names et al seems a daft idea (hit
me) and I'll definitely stay away from it. In hindsight, I feel I
could have changed the field name "locked" to "lpo_locked" just to
ensure Access doesn't hiccup on resolving the field name.

Lesson learned.

Rgds,
Prakash.
I see posts like "Don't use Name as a table field name. It's a reserved
word!" many times over the years in this ng. Where does it say that in
the documentation? It is a property, yes...but reserved? Who knows?

From A97 help, under the subject "Microsoft Jet Database Engine SQL
Reserved Words" I read
"The following list includes all words reserved by the Microsoft Jet
database engine for use in SQL statements"

I see the word "SQL" in the documentation line above. I don't see the
word "VBA" and there were no words for that reference. For example, I
don't know where it states "Name is a reserved word" anywhere. It may
be a myth, it may be the truth. If myth, then [Name] would make more
sense to use if referring to a table field called Name since "Name" is a
property.

I tried to find "reserved" anything in A2003 help but that was a
fruitless search for me. If you found reserved VBA words, what search
term did you use and what version of Access?

Maybe somebody can shed some light on reserved VBA words. BTW, I did a
google search and came up with this link from Allene Brown
http://www.everythingaccess.com/tuto...reserved-words.

From now on, maybe put [] around words that are properties or methods
or use Me. or Me! to be safe.

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.