Compile Error: "Method or data member not found" on Compile Database

brharrii

Registered User.
Local time
Today, 14:33
Joined
May 15, 2012
Messages
272
When I attempt to compile the database I'm working on I get an error message that says:

Method or data member not found.

Me.LabelList is then highlighted from my vba code:

Code:
Private Sub LabelList_DblClick(Cancel As Integer)
    DoCmd.OpenForm "frmLabels", acNormal, , "[LabelID] = " & Me.LabelList
End Sub

I've verified and double verified that this is the correct name of the list box being referenced and the code works fine when I double click on a record from the list box. The only Issue I seem to be having with it is when I attempt to compile my code.

Any ideas why I might be experiencing this problem?

Thank you,
Bruce
 
I don't pretend to know what wrong, but i would delete the me. of label as this may be causing the error .

regards Ypma
 
Remove the sub (Delete) and recreate it.
Is this help ?

PS. Do not use Copy-Paste
 
i would delete the me. of label as this may be causing the error.

There is absolutely no way including Me would cause the error. In fact omitting Me in that context would be a mistake.

Without Me to indicate the reference is to an object or Method of the current class object, Access will first look for a variable by the name.
 
I've verified and double verified that this is the correct name of the list box being referenced and the code works fine when I double click on a record from the list box.

Delete the listbox and place it again.

If that doesn't work, use the clipboard to copy all the controls on the form and paste them onto a new form. Likewise copy the module text to the new form's module.

Delete the old form and rename the new one to the original name. DO NOT rename the old form if Name Auto Correct is turned on, which it is by default.
 
Thanks for the suggestion Galaxiom,

I did try first to delete the list box and then recreate it. I then compiled the VBA again and got the same error message.

I then copied the controls from the old form into a new form and deleted the old form after copying over the VBA code. I got the form working like it was previously, but when I compile the database, it throws the error message again.

Any other suggestions?

Thanks again!
 
Mihail, I also tried recreating the VBA code, didn't copy paste, and I'm still getting the same error.
 
Very long shot here. Any chance it could be a typo with a numeric 1 instead of a lowercase L ?
 
Can you upload the DB ? No data is necessary. I use Access 2007 but, if you can save in 2003 will be the best.
 
Compile the VBA code and it will highlight the section of code in question. The control in question is on the form: frmNavigationPane.

Let me know if you have any questions,

thanks!
 
What I missing ?
I don't see any control named LabelList in your frmManageDatabase form.
 
Compile the VBA code and it will highlight the section of code in question. The control in question is on the form: frmNavigationPane.

Let me know if you have any questions,

thanks!

Perhaps. But the SUB is in frmManageDatabase :banghead:
 
What word from my previous posts you don't understand ?

The control is where you say, but the sub in trouble is where I say. It is, more than probably, a waste from the time when your control was in the form frmManageDatabase. Then, you moved the control but don't remove the event from the form module.
 

Users who are viewing this thread

Back
Top Bottom