Solved

"Compile: Error: Automation Error"

Posted on 1998-07-28
5
664 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now