problem when open a form

  • Thread starter Thread starter Mari via AccessMonster.com
  • Start date Start date
M

Mari via AccessMonster.com

when open a form apears next message:
"The expression On Open you entered as the event property setting produced
the following error: A problem occurred while MYDATABASE was communicating
with OLE server or ActiveX Control"
at On open Event procedure is:
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.

' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Implicit' "
Me.FilterOn = True

End Sub

thanks for any help
Mari
 
The message indicates a problem with references, or (more likely) a
corruption of the database.

To fix it, try this sequence:
1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database:
Tools | Database Utilities | Compact

3. Close Access.
Make a backup copy of the file.
Decompile by entering something like this at the command prompt while Access
is not running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

4. Open Access, and compact again.

5. Open the Immediate Window (Ctrl+G).
Choose References on the Tools menu.
Uncheck any references you do not need.
For a list of what references to use with each version, see:
http://allenbrowne.com/ser-38.html

6. Still in the Immediate window, choose Compile from the Debug menu.
Fix any error, and repeat until it compiles successfully.

Once you have it solved, see this article to help avoid it corrupting again:
Preventing Corruption
at:
http://allenbrowne.com/ser-25.html
 
Back
Top