Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RUN TIME ERROR 2465. Why is this happening?

Status
Not open for further replies.

dmon000

Technical User
Sep 9, 2003
79
US
Any ideas why this simple little procedure causes a run-time error 2465, Application-defined or object-defined error?
I changed the name of the text box twice and recompiled.

Private Sub txECN_NUMBER_Click()
[Forms]![fNP_201a_LIST].txECN_NUMBER = Me.txECN_NUMBER
End Sub

Thanks !!
 
when you type "ME." does intelisense show txECN_NUMBER as a property?

Is form fNP_201a_LIST open?

Try this

[Forms]![fNP_201a_LIST].txECN_NUMBER = 1234

Does it work? If it does then something is wrong on the right side.
 
MajP, thanks for your reply.
Yes, intelisense does show txECN_NUMBER as a property.
And yes, form fNP_201a_LIST is open.
Lastly, "[Forms]![fNP_201a_LIST].txECN_NUMBER = 1234" did not work.

Thanks for the suggestions. Any other ideas?



 
Is [Forms]![fNP_201a_LIST] by chance a subform loaded on the mainform? If it is you can not use this syntax, but must use

me.yourSubFormControlName.form =

if this did not work:
"[Forms]![fNP_201a_LIST].txECN_NUMBER = 1234"
then there is probably a spelling error in the naming.

run this code in your procedure and tell me what error if any you get.
msgbox [Forms]![fNP_201a_LIST].name
msgbox [Forms]![fNP_201a_LIST].txECN_NUMBER.name
msgbox Me.txECN_NUMBER

if I get an error in the first msgbox then there is something wrong in the syntax for the name of the form.

if I get an error on the second msgbox then there is something wrong with the name of the syntax on the text box

If the 3rd msgbox gives an error there is a problem with the syntax of the control txECN_Number on the current form.

txECN_Number is a text box not a label?

I Do not think what Joe is suggesting would make a difference because both are legitimate naming conventions. There are some very subtle differences in when this returns the value of the control or the value of the field underlying control with the same name.

Here is one final test.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top