HKFuey
asked on
Access: Method or data not found
I am sending an email from a tabbed form, the body of the email includes some of the text fields on the form.
If I try compile I get 'Method or data member not found'
I am using 'me.myfield' but one text box is giving the error.
If I try print the field name in immediate window I get "Variable not yet created in this context"
The code works for 'Forms!Mform.mytextbox', does anyone know why this is? (Something to do with tabbed control on form?)
If I try compile I get 'Method or data member not found'
I am using 'me.myfield' but one text box is giving the error.
If I try print the field name in immediate window I get "Variable not yet created in this context"
The code works for 'Forms!Mform.mytextbox', does anyone know why this is? (Something to do with tabbed control on form?)
this means that you are using a control name (textbox Name) that is not in the form.
When you create a form/report using the wizard or drag fields from the available fields list on to the form/report, Access gives the control name the same name as the underlying ControlSource. So, if the bound field is CustID, then the control name is CustID. If you create the control by using the ribbon and selecting a control type and drawing it, Access gives the control a name like text287 or listbox85. Good practice is to rename these controls at this time to meaningful names.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
most of the experts here will agree that if you are using one reference syntax, then stick with it throughout your entire code...
So you can actually accept your own post as the solution...
ASKER
Misleading error made me look at wrong control
You can use my LNC Rename add-ins to apply the standard LNC prefixes to controls (there are versions for different Access versions). It is a free download from my Website; the links below are for Access 2007 and up:
Controls only:
http://www.helenfeddema.com/Files/code63.zip
Objects and Controls:
http://www.helenfeddema.com/Files/code63.zip
(no points needed)
Controls only:
http://www.helenfeddema.com/Files/code63.zip
Objects and Controls:
http://www.helenfeddema.com/Files/code63.zip
(no points needed)