cant open code for a form!!

  • Hi,

    I've been developping an msAccess application for about 2 years and it's the first time I've seen this problem :

    SPECS:

    - front end : microsoft access 2002 (.adp)

    - back end : ms sql 2000 std edition sp4on Win2k box

    PROBLEM:

    It seems like a form is corrupted because I can't open the vba source code of this form and I can't export it (it hangs in both case). Though I can open it (in run and design mode) and run without any problems .

    - I've tried to compact and repair and it work well, but does not fix my form's problem

    - I've tried to export to anothed ms db: every objects exports well, except for this specific form (it hangs when trying to transfer)

    - I've tried to open the vba code and form from every way I know....

    Note: when it hangs, my CPU runs at 100%. I've left it run for about 20 to 25 minutes before forcing it to close.

    I've come to the point where I think of rebuilding my form from scratch.... but it would be SO long that I hope someone have another way!!

    Any help would be greatly appreciated!!

    Erik

  • For starters :

    if you have a recent backup of the ADP you can copy the working form from the backup under a new name, then update any modification mades since to the form and the delete the "problem" form and rename the old one.

    now if you don't have a backup, make a routine that makes a backup and run it often (mine runs every 20 minutes and backups all my ADPS (saved my job more than once...)).

    Now that you have a backup of the ADP you can try to run this in the command prompt. But beware this is UNSUPORTED by miscrosoft :: meaning it can work but it can also screw up the ADP some more (hense the make sure you have a backup of the current adp before running this part).

    create a batch file or just run directly in the command prompt :

    "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\path of the adp\Demo_Documentation.adp" /decompile

    when you run this command, make sure you hit the shift key so that no forms open when access opens the project. Then run compact and repair. Open the vba window and recompile the project. Compact and repair again.

    If that doesn't work delete the object and rebuild it.

    here's my backup routine : save as a vbs file and setup a task in task manager to run as often as necessary, then make a 2nd task that actually runs the update (Updates.bat which is created by this script)

    Dim FS 'As Scripting.FileSystemObject

    Set FS = CreateObject("Scripting.FileSystemObject")

    Dim BackUpPath 'As String

    Dim LaDate 'As String

    Dim TempPath 'As String

    Dim Script 'As String

    LaDate = Replace(Date, "/", "-")

    BackUpPath = "O:\Module\Backups_remi\"

    TempPath = BackUpPath & LaDate & "\"

    If Not FS.FolderExists(TempPath) Then

    FS.CreateFolder TempPath

    End If

    Script = "del /Q " & TempPath & vbCrLf

    Script = Script & "xcopy /y c:\modulesql\*.adp " & TempPath & vbCrLf

    TempPath = BackUpPath & LaDate & "\Documentation\"

    If Not FS.FolderExists(TempPath) Then

    FS.CreateFolder TempPath

    End If

    Script = Script & "del /Q " & TempPath & vbCrLf

    Script = Script & "xcopy /y c:\modulesql\Documentation\*.adp " & TempPath & vbCrLf

    BackUpPath = "D:\Modules\"

    TempPath = BackUpPath & LaDate & "\"

    If Not FS.FolderExists(TempPath) Then

    FS.CreateFolder TempPath

    End If

    Script = Script & "del /Q " & TempPath & vbCrLf

    Script = Script & "xcopy /y c:\modulesql\*.adp " & TempPath & vbCrLf

    TempPath = BackUpPath & LaDate & "\Documentation\"

    If Not FS.FolderExists(TempPath) Then

    FS.CreateFolder TempPath

    End If

    Script = Script & "del /Q " & TempPath & vbCrLf

    Script = Script & "xcopy /y c:\modulesql\Documentation\*.adp " & TempPath & vbCrLf

    Dim f 'As Scripting.TextStream

    Set f = FS.CreateTextFile("C:\Updates.bat", True)

    f.Write Script

    f.Close

    Set f = Nothing

    Set FS = Nothing

    the script makes a copy of all adps in 2 seperate locations but it also changes the location everyday so you always have multiple backups of each adps.

  • Thanks, I runned the decompile command and it worked well!! Believe me, I had try everything else!!

    I couldn't use my backups cause it my developement apps and it began to do that at the end of the day (the backup proc runs every night) and I didn't want to lose my day of work!!

     

    Thanks again, it's such a relief!

  • maybe you could modify my¸(or your) script so that it runs at least 4 times a day (making 4 different copies)...

    glad it worked 🙂

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply