Solved

"Compile: Error: Automation Error"

Posted on 1998-07-28
5
668 Views
Last Modified: 2008-02-01
Microsoft Access 97 Project near completion BUT:

Getting an error suddenly:

"Compile Error, Automation Error".  

Throws us into debug mode and highlights this code:

"dbs As Database".

Full code for combo box "notinlist" action:
===================================
Private Sub Church_Aff_Combobox_NotInList(NewData As String, Response As Integer)
    Dim intAnswer As Integer
    Dim dbs As Database, rst As Recordset
   
    intAnswer = MsgBox("Add " & NewData & " to the list of Church Affiliations?", vbQuestion + vbYesNo)
   
    If intAnswer = vbYes Then
        Rem Add church affiliation stored in Newdata argument to the Valid_Church_Affiliations table
        Set dbs = CurrentDb
        Set rst = dbs.OpenRecordset("Valid_Church_Affiliations")
        rst.AddNew
        rst!Church_Affiliation = NewData
        rst.Update
        Response = acDataErrAdded         'Requery the combo box list
    End If
End Sub
=======================================
Very confused on this one as the error does not occur on an earlier more simpler version of the package we are developing which DOES contain the notinlist action subroutine above but not a lot of other stuff we added later.  Any help appreciated.  Thanks in advance.
0
Comment
Question by:JFORTM1
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:clifABB
ID: 1467027
Just a thought:
Make sure there is a reference to Microsoft DAO:
  Select Menu Option Project/References
  Check one of the many Microsoft DAO versions (best choice for me is 2.5/3.5 Compatibility Library)
0
 
LVL 4

Expert Comment

by:tomook
ID: 1467028
Try repair/compact on the MDB as well. If this does not work, copy the form to a new name and see if it works. If not, try importing all the objects into a new MDB.
0
 

Author Comment

by:JFORTM1
ID: 1467029
Mother of God, tomook, it worked!!!!!!!!!!!!!

The Singlefest '98 committee at FUMC Fort Worth thanks you dearly for your suggestion.  If I can help you in some way contact me at

jfortm1@tandy.com.

I know a fair deal about wine, cigars and music if I could help in those arenas in some way.  Thank you again.
0
 
LVL 4

Accepted Solution

by:
tomook earned 110 total points
ID: 1467030
Since my suggestion worked, I shall submit this as an answer.
0
 

Author Comment

by:JFORTM1
ID: 1467031
Adjusted points to 110
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question