4

Having a problem with MS Access 2007 refusing to display a form in design mode. I can see the code for the form (if I go through the event properties of a button that displays the form), but I cannot see the form laid out as a GUI. And, when I try and invoke this form from the application's main window, it does not display and locks up the whole GUI.

Now, I tried putting debug before and after the display of this form, and the debug does get invoked.

Anyone have any ideas? I tried looking at the Trust Center, and I set "Enable all Macros", but that didn't seem to matter.

user229044
  • 232,980
  • 40
  • 330
  • 338
user1104028
  • 381
  • 7
  • 18

1 Answers1

3

A few steps I would take:

  1. Make sure your form has the Auto Center, Auto Resize properties set to Yes.
    I had an issue once with forms that opened outside the visible screen, Quite baffling.
    Also try to change its PopUp and Modal properties to it becomes just a normal non-blocking form for your tests.

  2. Your database may be corrupted.
    Make a copy of your database and then decompile and compact it.
    You can do that from the command line, for instance:

    "C:\Program Files\Microsoft Office\Office12\msaccess.exe" "D:\Code\mydb.accdb" /decompile /compact
    
  3. Export the VBA + Form resource, then delete the form from your Access client, then do the decompile+compact above again, then re-import the form.

    ' Export form and VBA to text files '
    Application.SaveAsText acForm, "myForm", "myForm.txt"
    
    ' Import form and VBA from text files '
    Application.LoadFromText, "myNewForm", "myForm.txt"
    
Renaud Bompuis
  • 16,596
  • 4
  • 56
  • 86