+ Reply to Thread
Results 1 to 3 of 3

Copy Contacts VBA ActiveX Code Error

  1. #1
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Copy Contacts VBA ActiveX Code Error

    I download a free contacts DB lesson from Internet and have successfully configured it to my needs (this is a hobby project to improve my VBA knowledge)

    In the same workbook I added a new sheet and made a new userform all with ActiveX controls. The VBA project editor consists of these sheets:
    Module1
    Sheet1 (phonelist), from the downloaded lesson
    Sheet2 (Interface), from the downloaded lesson
    Sheet3 (MyForm), my new ActiveX form
    Sheet4 (MyDB), my new sample DB
    ThisWorkBook

    I now doubleclick on a control button in my new ActiveX form in order to copy the existing lesson code into this new control (which I will revise to include the references from my new DB) but as an example I get this error.

    If Me.txtSurname.Value=””_ (Error says Method or data member not found)

    I’m sure this is related because I don’t properly refer to my new ActiveX form. How I can overcome this error?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Copy Contacts VBA ActiveX Code Error

    Hello oskar44,

    From what the error is saying, you don't have a control on the user form named txtSurname. Another reason you might receive this error is from executing theis statement from a Worksheet Module like Sheet1. The keyword Me can refer to different objects. It is not solely associated with a VBA UserForm.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    09-29-2014
    Location
    Montreal, Canada
    MS-Off Ver
    2013
    Posts
    222

    Re: Copy Contacts VBA ActiveX Code Error

    Thanks for your time Leith, I will work it out somehow

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Copy ActiveX Button and Code to another Worksheet
    By Jan Lichtenbelt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-13-2014, 07:20 AM
  2. Copy ActiveX ComboBox from One Sheet to Another and Then Have it Execute Code
    By mawalker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-13-2013, 09:47 AM
  3. VBA code to copy activex control with its code
    By mardyl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2011, 12:52 AM
  4. Not able to select multiple contacts to email from a Shared Contacts
    By champs in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 03-10-2009, 02:08 AM
  5. Error message when trying to import csv into Outlook contacts.
    By cphoward@charterinternet.com in forum Excel General
    Replies: 1
    Last Post: 04-13-2006, 10:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1