There is a compiling error in our form

access2010

Registered User.
Local time
Yesterday, 20:11
Joined
Dec 26, 2009
Messages
1,115
The form = VendorContact’sDiary

The button [K] Vendor_Website

The = OnClick = [Event Procedure] is not copying the contents of the field [Vendor_Contacts.VC_WebSite] as a compiling error is occuring

Your assistance will be appreciated.

Nicole
 

Attachments

There is no field nor control named Vendor_Contacts_Vendor_Website. There is a textbox named Vendor_Contacts.VC_Website

Should not use punctuation/special characters (underscore only exception) in naming convention.
 
If there is a Compile error, you SHOULD have gotten a situation where compiling from the Code window's menu bar jump-scrolls you to the offending line.

But if you don't have "Option Explicit" in place for that module (whether general or class module doesn't matter, it applies to both) then that jump action won't occur.

Instead, the compiler would just silently CREATE a variable to match the incorrect name. Which is probably what happened in your case. I didn't open the DB because it just isn't what I do, so that means I can't tell whether you in fact DO have Option Explicit in the appropriate declaration area of your modules.

And IF my guess was right, this situation is an example of WHY you want to use Option Explicit at the top of EVERY module.
 
Module has neither Option Explicit nor Option Compare Database. The compiler still jumps to the offending line because of the Me. qualifier prefix. The error is "Method or data member not found."

Next time, post the EXACT error message.
 
Thanks, June7. I don't open randomly posted database ever since I got one that my anti-virus flagged for me.
 
Thank you for your suggestions for our MsAccess 2003 Database.
Below is our code which produces an error message.
Can you please advise as to what I have done wrong?
===

Private Sub K_Vendor_Website_Click()
If Nz(Me.Vendor_Contacts_K_Vendor_Website, "") <> "" Then
With Me.Vendor_Contacts_K_Vendor_Website
SetFocus
SelStart = 0
SelLength = Len(.Text)
End With
DoCmd.RunCommand acCmdCopy
'MsgBox "Text Copied into Memory"
Else
MsgBox "There is no text for copying"
End If
End Sub
 
As already suggested, use the actual name of the control or change the name of control to match the code. See post #2.

You still didn't post the EXACT error message.

Also, post code between CODE tags to retain indentation and readability.
 
The control you are referencing in your VBA does not exist in your table or anywhere else. Hence the error "Method or data member not found". As June7 has alluded to.

attachment.php
 

Attachments

  • Capture.JPG
    Capture.JPG
    64.5 KB · Views: 624

Users who are viewing this thread

Back
Top Bottom