views:

165

answers:

4

I have a database that I've converted over to 2007 Access. I ended up rebuilding the Combo boxes. They all work fine in the active databae however as soon as I close the database and reopen it - they don't work and a number of errors are displayed..

If I create a second combo the same way -Then both combos start working... but once again as soon as I've closed the database and reopen it.. they both stop working?

These are simply combo boxes that search the current FORM to find a record..

ie.. Field "Company Name" - Combo is searching for a particualar company record as entered or selected from the drop down combo box.

In the database settings / trustcentre I've switched on true all marcos etc.

What have I missed?

A: 

Would it be possible to provide the error messages you receive?

overslacked
The error messages times out the marco with "Gosub" required.. I've managed to work around the problem by - opening the database, then saving it as a copy in Ver 2003 - then I copy the FORM back in to the 2007 version of the database - all combo drop downs work.. hmm
A: 

Maybe a Compile and/or Compact and Repair is needed?

Jeff O
I've used the automatic compact feature when closing the database. thanks
Don't use COMPACT ON CLOSE -- it's way too dangerous. You should try DECOMPILE, though.
David-W-Fenton
A: 

I have found that self-certifying projects is a reliable way to ensure that code will run.

http://office.microsoft.com/en-us/access/HP010397921033.aspx

Remou
A: 

A couple of things:

  • try decompiling the project. It may have been corrupted.
    Just open your file from the command line and add the /decompile parameter.
    Then just rebuild your project and compact it.

  • Make sure your references in the VBA IDE > Tools > References... contains the correct libraries:

    Visual Basic For Application
    Microsoft Access 12.0 Object Library
    OLE Automation
    Microsoft Office 12.0 Access database engine Object Library
    Microsoft Office 12.0 Object Library

The OLE Automation is sometimes source of strange issues: It sometimes gets automatically selected on my Windows Server 2008 x64 machine but I have to disable it on my Windows XP 32bit desktop...

Renaud Bompuis
There's really nothing in the OLE Automation library that I can imagine anyone needing (certainly not by default), so I always remove it. I would also eliminate the Office references -- they really aren't needed. And you omit any DAO reference (I don't know the name of it in A2K7).
David-W-Fenton
Just noticed that I said DAO reference was omitted, but that's what "Access database engine Object Library" refers to, so it was omitted after all.
David-W-Fenton