UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Vba Code Has Disappeared.    
 
   
dhapp
post Jan 21 2012, 09:11 AM
Post #1

UtterAccess Guru
Posts: 884
From: Hamburg, NY



All VBA code, from all of my projects has disappeared.

Today, when I picked up work on a project I was unable to find any of the VBA code.
The module icons show in the navigation pane.
Clicking on an icon in the navigation pane shows the Microsoft VBA editor window but it is completely empty.
Command buttons that use VBA code all produce the error message that would be expected when the code is missing.

This same symptom occurs for all projects, of which I have many.
I opened a project that hadn't been open for many week; same result, not VBA.

Help.
Go to the top of the page
 
+
Peter46
post Jan 21 2012, 09:28 AM
Post #2

UtterAccess VIP
Posts: 7,489
From: Oadby Leics, UK



Are you using Access 2010 SP1?
Go to the top of the page
 
+
dhapp
post Jan 21 2012, 11:13 AM
Post #3

UtterAccess Guru
Posts: 884
From: Hamburg, NY



No, I am using Access 2007.

Addition info: If I create a new module it will not show any code in the editor.
Go to the top of the page
 
+
Peter46
post Jan 21 2012, 12:52 PM
Post #4

UtterAccess VIP
Posts: 7,489
From: Oadby Leics, UK



If you are able to post one of the files maybe we can take a look.
I've never heard of this happening other than for the version I asked about.

(Later)

Googling this problem, it appears this is not uncommon with A2007 but the only posted 'solution' I have seen is to go to a backup.
The most common situation where this has occurred is where the database has not been split and is being used by more than one user - which is always a recipe for problems.

Is your version of A2007 up to date in terms of service releases (SP2 I think).
Go to the top of the page
 
+
dhapp
post Jan 21 2012, 02:42 PM
Post #5

UtterAccess Guru
Posts: 884
From: Hamburg, NY



I think that I have discovered the cause.

I took one of my databases which is not split and used a flash drive to put it on the desktop of another computer that also has Ac 2007.

All of the code was there.

This makes me think that the editor has somehow crashed and needs to be reinstalled.

I will try inserting the distribution disks and running the repair; if that doesn't work I will remove Access and reinstall it.

Thanks.
Go to the top of the page
 
+
dhapp
post Jan 21 2012, 09:08 PM
Post #6

UtterAccess Guru
Posts: 884
From: Hamburg, NY



I used the Ms Office Professional 2007 distribution disk to repair the installation, rebooted and tried to use the VBA editor. No code shows.

I again checked the same file on my other machine which also has Office 2007. The VBA editor works as it usually does.

I uninstalled office, rebooted, installed the whole suited ("Run All From Computer"), rebooted and the VBA editor still does not show any code.
If I attempt to use a command button that relies on code I get an error as if the code was not there.
Taking the same file to my other computer and the command button works as it should.

Does anyone know if the VBA editor is a part of office or it it part of XP?

I'm really stumped.
Go to the top of the page
 
+
GroverParkGeorge
post Jan 21 2012, 10:17 PM
Post #7

UA Admin
Posts: 21,370
From: Newcastle, WA



The VBA IDE is part of the Access application. This is a whole new problem to me. Is it possible to share a small db with this problem? Maybe someone can spot something in it.

One thing that you ought to rule out, though, is the problem of Trusted Locations and enabling macros. I know that sounds odd since it would mean something else changed in your environment.

Go to the top of the page
 
+
dhapp
post Jan 22 2012, 12:09 AM
Post #8

UtterAccess Guru
Posts: 884
From: Hamburg, NY



George,
Thank for weighing in on this issue.

I have attached a small db file that uses VBA code. I am quite certain that you will have the same experience that I have on my 'other' computer, i.e. it will work fine.

This problem seems to only exist on my laptop. Removing Office and then reinstalling it should have fixed it but did not. ???

Thanks
Attached File(s)
Attached File  WebServiceSandbox.zip ( 38.95K ) Number of downloads: 4
 
Go to the top of the page
 
+
Peter46
post Jan 22 2012, 04:08 AM
Post #9

UtterAccess VIP
Posts: 7,489
From: Oadby Leics, UK



Code is visible here in A2010.

So as you have said, it looks like a build problem on your laptop but I would have no real idea how to diagnose such a problem.
Go to the top of the page
 
+
mesersmith
post Jan 22 2012, 04:35 AM
Post #10

UtterAccess Veteran
Posts: 363
From: romania, calarasi



And in 2007 is also visible, and work fine.
I always install a fresh copy of windows on every 2-3 monts, because it's moving slow.
Why don't you put another copy of your sistem and try again?
It's sure that the code doesn't go anywhere, just your soft doesn't see it.

This post has been edited by mesersmith: Jan 22 2012, 04:37 AM
Go to the top of the page
 
+
dhapp
post Jan 22 2012, 09:42 AM
Post #11

UtterAccess Guru
Posts: 884
From: Hamburg, NY



Thank you to both of you for responding and confirming my hypothesis.
Apparently the VBA IDE is corrupted in such a way that removal and reinstalation does not touch.
I noticed that after the reinstalation the Quick Access Toolbar still has my entries so some things were not removed. I wonder if there are IDE settings in the location where the QAT is stored...

Still stumped, but grateful to know that the code is still intact.
Go to the top of the page
 
+
dhapp
post Jan 22 2012, 10:32 AM
Post #12

UtterAccess Guru
Posts: 884
From: Hamburg, NY



To anyone who is following this thread --- I'm not crazy.

I turned on my laptop today and the code is back, along with the functionality associated with the code.

Pretty spooky.
Go to the top of the page
 
+
pdskinn
post Jan 24 2012, 12:37 AM
Post #13

New Member
Posts: 2



I created a MS Access DB and I have two cases where all the VB Code has disappeared! Both times the server where the DB is located went down while the user was in the DB. Both times the VB code completely deleted! I tried everything in my power to get it back in but no success. I copied the the queries, forms and reports from a working copy and pasted them back into the DB and of course it worked again but if I wouldn't have done this, I would have been stuck.
Does anyone have an idea why it does this?

I am running MS Office Suite 2007.

Thanks for any and all help!

Paul
Go to the top of the page
 
+
dhapp
post Jan 24 2012, 09:03 AM
Post #14

UtterAccess Guru
Posts: 884
From: Hamburg, NY



Paul,

Welcome to UA.

Is the db split, i.e. is the back end (tables) on the server and the front end (all other objects) distributed to each workstation?
Are you sending data to the serve via a wireless connection?
Does the server do a full backup every 24 hours?

Doug

Go to the top of the page
 
+
pdskinn
post Jan 25 2012, 03:16 PM
Post #15

New Member
Posts: 2



The DB is not split. The users can go directly into the DB. I have the compact and repair function checked on it so each time you close the DB it completes a compact and repair. I know that this has been problematic in the past. All our connections are wired, however, some times we lose conectivity with our servers. This has happened twice with two different servers in two different locations.
Go to the top of the page
 
+
dhapp
post Jan 25 2012, 09:13 PM
Post #16

UtterAccess Guru
Posts: 884
From: Hamburg, NY



Paul,

If you have multiple simultaneous users on an unsplit db then you should expect bad things to happen.
Losing code is the least of your problems; there is a very good chance that you will lose data.

The fact that you lose connectivity to the server is the first place to start. Whoever does your IT needs to figure out where that problem lies and fix it.
Then split the database. Need help?
Distribute a linked front end application, not a shortcut, to each workstation.

Also, I don't recommend Compact and Repair on close.


Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Search  ·  Go to Top  ·  Lo-Fi Version Time is now: 18th April 2014 - 06:56 AM