Results 1 to 8 of 8
  1. #1
    batowl is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2010
    Posts
    86

    "The object doesn't contain the Automation object".' error

    Hi All,



    I have a set of tables and forms for data entry on one subject. It all works fine. I needed to duplicate the table structure and forms for another subject within the same database so I copied the tables and forms within the database for this new topic.

    All looked and acted fine until I tried to enter data on my first subform on this new/copied form for this second topic. Whenever I try to enter my first piece of data on this subform I get the error "The object doesnt contain the Automation object 'Salmonella_Water.' (I believe that is referring to a table within the database which this subform is at least partially based upon - and the table is present).

    I can click OK to eliminate this box and fill in the subform, but then when I try to leave the subform, I get the message that the "Index or primary key cannot contain a null value". So it appears that the child table that this subform is based upon is not getting the primary key from the parent table when I enter data.

    Any thoughts on how to remedy this?

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Open the main form in design view.
    Open the properties dialog window and click on the SUB FROM CONTROL (not the subform itself). Check to see if the master/child links are set correctly.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Steve's suggestion certainly sounds like the solution to your immediate problem, but I have to tell you that your statement

    Quote Originally Posted by batowl
    ...I needed to duplicate the table structure and forms for another subject within the same database so I copied the tables and forms within the database for this new topic...
    almost assuredly means that your database is not Normalized! Instead of duplicating Tables you should have a Field that denotes the given subject, and pull up Records for a given subject by filtering the Form on this Field. Having multiple Forms based on a single Table presents no real problems, other than maintenance, if it makes for easier user interaction.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    batowl is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2010
    Posts
    86
    Thanks for the suggestions, but for the life of me, I cannot seem to find the subform control that you referenced Steve. I am in Design View of the main form and cannot locate it in Access 2003. All I see in the list is the subform itself. Could you please clarify for me how I should access it?
    I attached the full error message that I am getting too.

    Click image for larger version. 

Name:	Error-Screenshot.jpg 
Views:	12 
Size:	29.7 KB 
ID:	21237

  5. #5
    batowl is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2010
    Posts
    86
    It never fails. As soon as I post that I cannot find it, I find it.

    Yes, the Master/Child links appear to be set correctly.

    What else could be the problem?

  6. #6
    batowl is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2010
    Posts
    86
    Ok, there appears to have been a small error in the Master/Child links. Instead of the link child field being "FormName_PrimaryKey", it was "FormName.PrimaryKey".

    That resolved the issue of this "Automation object error", but now every time I change records it asks me to Enter a Parameter Value for the "FormName_PrimaryKey". Once I cancel out of that (or hit Ok without entering anything) the box goes away but the form does not hold any of the data. So obviously something is still wrong...

  7. #7
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Instead of the link child field being "FormName_PrimaryKey", it was "FormName.PrimaryKey".
    it should just be PrimaryKey

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    "FormName.PrimaryKey" would show up if the Master PK field has the exact name as the child FK field.
    I always name the PK field with a suffix "_PK" and the foreign key field with "_FK". Never have naming problems.

    Did you select the fields using the combo boxes?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 08-07-2014, 10:28 AM
  2. Replies: 1
    Last Post: 12-27-2013, 01:59 PM
  3. Replies: 1
    Last Post: 07-02-2013, 08:41 AM
  4. Replies: 1
    Last Post: 04-10-2012, 08:48 AM
  5. Replies: 3
    Last Post: 11-02-2010, 10:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums