Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

"Compile: Error: Automation Error"

Posted on 1998-07-28
5
Medium Priority
?
721 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 440 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

927 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