Error Message Regarding "Automation Object"

LadyDi

Registered User.
Local time
Today, 15:04
Joined
Mar 29, 2007
Messages
894
I have a tabbed form in my database. The top section of the form contains the customer information. Then the tabbed section contains information regarding different agreements my company has with the customer. The information on each of the tabs is housed in a different table. This database has been up and running fine for a couple months. I have just started getting a weird error message, and I cannot figure out what it means. The error message reads "The object doesn't contain the Automation object 'Main Table.' You tried to run a visual basic procedure to set a property or method for an object. However, the component doesn't make the property or method available for Automation operations. Check the component's documentation for information on the properties and methods it makes available for Automation operations." The only thing that I have done to this database in the last couple weeks is copy the structure of a couple tables, because my manager wants "Archive" tables in the same database. I can add a record to the query behind my form, but I cannot add a record to my form without getting this message. What does this message mean? What do I need to do to correct it?
 
A few questions...
When do you get the error; what do you do just before it happens? When the error occurs does it break into the code debugger at a particular line? In design view, remove subforms one at a time. Can you identify that the problem only occurs when a particular subform is loaded?
 
The error occurs everytime I try to make a new entry on my first subform (whether I am adding a new customer or making a new entry for an existing customer). I tried making an entry on the other subforms, and had no problem. The only form I have a problem with is the one regarding the master agreement. The error does not break into the code at all. As a matter of fact, when I click OK, it will actually let me go ahead and make the entry. However, when I try to go to the next record, it will not let me save the information that I just entered.
 
Try importing everything into a blank new db, remember to compile and save all module code
 
Have you checked to see if any of your references have been broken? It could be an object reference that has stopped working.
 
How can I check to see if my references have been broken? I ran the database analyzer and it did not come back with any suggestions for this form.
 
Open up VBA, (ALt F11).

From the menu choose Tools > References.

Look at all the reference links that have a check box ticked. Read carefully to see if any say "broken links" or "missing link". If they you may need to look further down the list and reselct the reference again. Else you may have a reference file missing that needs copying back on your PC.
 
None of the marked references say "broken" or "missing" link.
 
I just tried importing everything into a blank database and I am still getting the same message.
 
Check to see if you have inadvertently put code in the Event PROPERTY dialog instead of the VBA window. That is a frequent source of this error.
 
Do you get an error on re-compiling your code?

[Alt F11] to go to VBA.

Debug > Compile.

If compile is "greyed out" change some of your code, then change it back again. (To fool VBA into thinking you have made a change) Then try recompiling again. Do you get an error?

Have you tried VBA help and searching for "Automation with Microsoft Access"? Any clues there? Else you may have to post your mdb....
 
Where can I find the Event PROPERTY dialog to see if I have code there?

I compiled my code several times, and it did not find any errors.
 
Where can I find the Event PROPERTY dialog to see if I have code there?
When you are in design view of a form, you go to the properties window and if you click on the EVENTS tab, look to see if you have anything in there that

1. doesn't say [Event Procedure] OR
2. doesn't have the name of a macro OR
3. Is a formula without an = sign next to it


I compiled my code several times, and it did not find any errors.
If it is what I suspect, compiling would not find this.
 
I looked at the Event tab for my form, and there is an "Event Procedure" on the On Current event, Key Preview shows "No", and Timer Interval shows "0". I tried to delete the No and the 0, but the database wouldn't let me. Below is the code that I have on the On Current Event, could the problem lie in here?

If Me.Original_Expiration_Date <= (Date + 90) Then
Me.Detail.BackColor = 8421631
Me.Agreement_nearing_expiration.Visible = True
Else
Me.Detail.BackColor = -2147483633
Me.Agreement_nearing_expiration.Visible = False
End If
If Me.Pending_Renewal = "yes" Then
Me.Detail.BackColor = 16744448
Else
Me.Detail.BackColor = -2147483633
End If
If Me.Pre_approved_Discount___Set_Pricing = "Pre-approved Discount" Then
Me.See_List.Visible = True
Else
Me.See_List.Visible = False
End If
If Me.Pre_approved_Discount___Set_Pricing = "Set Price" Then
Me.See_Agreement.Visible = True
Else
Me.See_Agreement.Visible = False
End If
 
Here is a copy of my database. All information has been removed.

Clicking the Edit All Listings button on the first screen will take you to the form in question. The first tab is the only one that I am having a problem with.
 

Attachments

Well, it seems to run fine for me (WinXP SP3, Access 2003 SP1). However, I do note that you should NOT have fields with special characters (do not use parentheses or slashes in the field, or object, names).

Also, why in the world would you have a field named Autonumber (autonumber type) in the Customers table and then not use it as the primary key, but instead use a composite key? That makes absolutely no sense whatsoever.

Also you are using lookups at TABLE level which are a BIG NO NO. Get rid of them and use them at FORM level. See here for why.

What version of Access and what service pack are you on?
 
I have an answer, still trying to find out why. In your query "MPA Query", change the Main Table autonumber so it says something like MTAU: autonumber.

pic1.JPG

We will use the MTAU as the Child-Master Link to your subform in TabForm. Child = MTAU, Master = autnumber.

pic2.JPG

I stopped getting your error.
 

Users who are viewing this thread

Back
Top Bottom