MS Access 2016 gives error message, "Compile error: Method or Data Member not found" No idea why

Anonymous
2019-08-09T19:00:52+00:00

I have been asked to handle Social Media for our university Center.  I created an Access 2016 data base and everything seemed fine. However, now I keep getting an error message, and I have no idea how to fix it. The error message says "Compile error: Method or Data Member not found"

After that it says: 

"Option Compare Database

Private Sub Text_Twitter_AfterUpdate()

Me.MemoFieldName.SelStart = 0

Me.MemoFieldName.SelLength = Len(Me.MemoFieldName)

DoCmd.RunCommand acCmdSpelling

End Sub"

Now the Database is broken. :(

First

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} vote

6 answers

Sort by: Most helpful
  1. Duane Hookom 26,595 Reputation points Volunteer Moderator
    2019-08-09T19:04:19+00:00

    Hi 1Family,

    You should have Option Explicit at the top of every module immediately below the Option Compare Database

    Option Compare Database

    Option Explicit

    This should then be used with regular compiling of your code after every change.

    0 comments No comments
  2. ScottGem 68,780 Reputation points Volunteer Moderator
    2019-08-09T20:44:08+00:00

    It would appear that you don't have a control named Text_Twitter on your form. Maybe you changed the name or it has a space instead of an underscore.

    0 comments No comments
  3. Tom van Stiphout 40,096 Reputation points MVP Volunteer Moderator
    2019-08-10T02:11:19+00:00

    I'm not so sure Scott; if it did not exist, how did its AfterUpdate event get invoked?

    More likely MemoFieldName does not exist.

    0 comments No comments
  4. ScottGem 68,780 Reputation points Volunteer Moderator
    2019-08-10T02:17:05+00:00

    Could have been deleted.

    0 comments No comments
  5. Anonymous
    2019-08-12T18:20:02+00:00

    Hi Scott and Tom.  Thank you very much for your replies. I think I know what has happened, but I'm not exactly sure what I should do to fix it. I'm not really a newbie, because I began using Access over 20 years ago, but I haven't used it much in over a decade, and I have enjoyed getting back into it.  Regarding this problem, I did something that in retrospect I should not have done, which is this.

       After the database was basically finished and I had a set of tables, forms, and queries, I wanted to clean it up.  I originally created unnecessarily complicated names. I changed the name of the Table from "T-Data_SM+RSCH-DB" to "T-Data_SMDB" (SMDB for "Social Media Database.") I changed the name of the form from "F-Data_SM+RSC" to "F-Data_SMDB".  I thought that if one made changes to the names that the new names might automatically populate themselves as needed. I wasn't entirely clueless, because when I made the changes, I continued to test the database and everything seemed to work exactly as it should have. The problem didn't arise until I closed the database and reopened it.  That was probably a week after making the changes and so that is why it didn't occur to me that that the name changes might be the source of the problem.  I suspect that somewhere the database is looking for the old names and can't find them.  If that is the source of the problem, I would like to enter the corrections where needed, but I'm not sure how to do so.  I don't know any coding, so I hope it won't be too complicated to make the needed adjustments. 

    It seems that I may have created this problem, and if so, my apologies for having to ask for help to fix it. 

    All the best, 

    Bob

    1 person found this answer helpful.
    0 comments No comments