Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

"Compile: Error: Automation Error"

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
Suggested Courses

715 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