Results 1 to 6 of 6
  1. #1
    gemadan96 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    110

    Automation Error from form

    I have two forms for a table called Locations. The first is Location List which is a split form contain a datasheet of all the locations. The second is Location Detail where I can view/edit more information about the location. The datasheet contains a link to open the location detail for the selected record. The location detail form has two buttons. One is for Save and New and the other is for close.



    If I open the Location Detail form without the location list open everything works fine. If I have the Location List open and then open the Location Detail form the Save and New button works fine. If I click the Close button I get an error. The close button is just a macro with just a close window action.

    The error I get is: The object doesn't contain the Automation object 'PID.'

    PID is a primary key field in an unrelated table. I've gone through every control on each form looking for a reference to PID in all the properties, macros, and VBA code and have found nothing. I have run a compact and repair and done a decompile and still I get this error.

    I don't get this error with any other forms in my application.

  2. #2
    gemadan96 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    110
    I also get this same error if I click on the built-in close button in the upper right corner of the window.

  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
    The first line of your post explains the problem:

    Quote Originally Posted by gemadan96 View Post
    I have two forms for a table called Locations.
    Two Forms based on the same Record Source means that one of the Forms will not be editable, since you have the same Record open twice, in different Forms. If you get into Editing the Records, you'll also start having Write Conflicts, always a hairball to sort out!

    You either need to have a separate Table for the Location Details, and use a Main Form/Subform scenario, for display/data entry, or open the Form for the Details Table as a popup, or you need to use a a single Form with a Tabbed Control in order to have room to display all of the Fields.

    How many Fields does this Table have? As a general rule, if a Table contains more than 25-30 Fields, it is almost sure to be non-normalized.

    Linq ;0)>
    Last edited by Missinglinq; 05-20-2014 at 07:08 PM.
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    gemadan96 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    110
    The database was started with the Contacts Management template available from Microsoft. It has a table called contacts. There is a form called contact list. Its a split form that just displays the datasheet listing all the records. There is a text box control that provides a link to open the Contact Detail form for the selected contact. Using the same methods the location table, list form, and detail forms were created. When the detail form is opened, for either table, the list form is not closed, but nothing can be edited in the list form until the detail form is closed.

    There are only about a dozen fields in the location table.

    The main form/subform is not necessary. This issue does not occur for the Contacts table/list/details or the Promotions table/list/detail.

  5. #5
    gemadan96 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    110
    After reviewing yet again the macro in the Location List form that opens the Location Detail form I found the reference to PID. Changed it to LID and now the form closes without an error.

  6. #6
    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
    Ouch! PID can be a sore subject! Sorry; that's an insider medical joke!

    Glad you got it working!

    Good luck with your project!

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

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 0
    Last Post: 12-15-2011, 11:57 AM
  2. IE Automation Error
    By bucko_oz in forum Programming
    Replies: 1
    Last Post: 09-19-2010, 11:28 PM
  3. Replies: 0
    Last Post: 03-04-2010, 06:32 PM
  4. automation error
    By ashiers in forum Forms
    Replies: 0
    Last Post: 04-16-2009, 11:38 AM
  5. Automation Error
    By aouellette in forum Forms
    Replies: 0
    Last Post: 09-12-2008, 08:00 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