Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2008
    Posts
    11

    Exclamation Unanswered: Totally Lost VBA code

    Does any body faced with this problem:
    Already my second client reported this: a morning comes up with problem that they Access database app does not work by showing error:

    "The expression you entered has a function name that Microsoft Office Access can't find."

    When I open up them to view the code I see that all my VBA code are gone - nothing under forms, modules are listed in main window, but not available in VBA editor.

    What could be a problem?
    Are there any solutions to avoid this?
    Both of clients are keeping their databases on network share.
    One reported that they have some server restart in last night. If it (db) has open, could it cause such problem.
    Another reason that I could guess is that database is 2003 format but users are working in 2007.

    Thanks in advance and looking forward,
    Janeks

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Usually when vba code mysteriously dissappears, there's a corrupt form or other problem and the database needs to be compacted/repaired.

    The error you indicated is usually caused by:
    1. A field is named with a reserved name (ie. a field named: Date, Table, Field or other reserved name.)
    2. A missing reference which would cause other reference not to load and produce the error you indicated.

    From testing 2003 mdbs with some users opening it with 2007 and others with 2003, I've had some problems where once a user opens the mdb in 2007, it becomes problematic for the 2003 users to then open. Depending on the code/functions/modules involved, there are many possibilities which is difficult to say what is causing your specific problem.
    Last edited by pkstormy; 04-14-10 at 21:51.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Jul 2008
    Posts
    11
    While it could be the reason 1 (I have some fields named Name, Description also in second case Date), I doubt for it, because the problem appears sporadically. I.e. users work normally to the end of a day, then in next morning on next open the problem appears.
    I never got that problem on my PC.

    The second reason also - I had already such problems, but in that cases I am getting another error about missing references and database simply does not loads, but VBA code stay in their places.
    Last edited by janeks_k; 04-15-10 at 02:42.

Posting Permissions

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