Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 08-10-2018, 06:49 PM   #1
access2010
Newly Registered User
 
Join Date: Dec 2009
Posts: 362
Thanks: 166
Thanked 1 Time in 1 Post
access2010 is on a distinguished road
There is a compiling error in our form

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
Attached Files
File Type: mdb K_Copy_WebSite_Address.mdb (176.0 KB, 23 views)

access2010 is offline   Reply With Quote
Old 08-10-2018, 09:53 PM   #2
June7
Newly Registered User
 
Join Date: Mar 2014
Posts: 808
Thanks: 0
Thanked 182 Times in 182 Posts
June7 will become famous soon enough
Re: There is a compiling error in our form

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.
__________________
To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.
June7 is offline   Reply With Quote
Old 08-11-2018, 05:56 AM   #3
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 12,468
Thanks: 62
Thanked 1,174 Times in 1,074 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: There is a compiling error in our form

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.

__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
Old 08-11-2018, 09:41 AM   #4
June7
Newly Registered User
 
Join Date: Mar 2014
Posts: 808
Thanks: 0
Thanked 182 Times in 182 Posts
June7 will become famous soon enough
Re: There is a compiling error in our form

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.
__________________
To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.
June7 is offline   Reply With Quote
Old 08-11-2018, 04:41 PM   #5
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 12,468
Thanks: 62
Thanked 1,174 Times in 1,074 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: There is a compiling error in our form

Thanks, June7. I don't open randomly posted database ever since I got one that my anti-virus flagged for me.
__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is offline   Reply With Quote
Old 08-12-2018, 08:23 AM   #6
access2010
Newly Registered User
 
Join Date: Dec 2009
Posts: 362
Thanks: 166
Thanked 1 Time in 1 Post
access2010 is on a distinguished road
Re: There is a compiling error in our form

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
access2010 is offline   Reply With Quote
Old 08-12-2018, 09:02 AM   #7
June7
Newly Registered User
 
Join Date: Mar 2014
Posts: 808
Thanks: 0
Thanked 182 Times in 182 Posts
June7 will become famous soon enough
Re: There is a compiling error in our form

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.

__________________
To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.
June7 is offline   Reply With Quote
Old 08-12-2018, 09:09 AM   #8
AccessBlaster
.
 
Join Date: May 2010
Posts: 869
Thanks: 20
Thanked 235 Times in 225 Posts
AccessBlaster will become famous soon enough AccessBlaster will become famous soon enough
Re: There is a compiling error in our form

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.

Attached Images
File Type: jpg Capture.JPG (64.5 KB, 37 views)

AccessBlaster is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
error when compiling tiku Modules & VBA 4 02-15-2012 08:01 PM
Compiling error - sql statements CuriousGeorge Modules & VBA 15 03-21-2011 04:55 AM
linking records compiling error - method or data member not found CuriousGeorge Modules & VBA 19 03-10-2011 12:04 PM
Trying to Call Module and getting compiling error mtrant Modules & VBA 3 08-25-2008 06:15 AM
compiling? Graham Bucknall General 1 09-12-2003 06:37 AM




All times are GMT -8. The time now is 10:28 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World