Solved

"Compile: Error: Automation Error"

Posted on 1998-07-28
5
694 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Suggested Courses
Course of the Month4 days, 17 hours left to enroll

636 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