![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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. |
#3
| |||
| |||
|
|
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. |
#4
| |||
| |||
|
|
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. |
#5
| ||||
| ||||
|
|
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. |
|
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 ? I often use Msgbox to see the value of something. Maybe in the |
|
Would love some input on this. Thx & Best Rgds, Prakash. |
#6
| |||
| |||
|
|
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. |
|
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. |
#7
| |||
| |||
|
|
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. |
#8
| |||
| |||
|
|
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 - |
#9
| |||
| |||
|
|
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 ? |
#10
| |||
| |||
|
|
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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |