Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2013
    Posts
    4

    Unanswered: How to add record using form

    I am using Access to manage a database that I ported from Knowledgeman, which has not been popular in decades. I have transferred the database successfully and have devised some queries and forms, but I am having trouble creating a data entry page.

    The database is the index to a record/CD collection. One table is songs, one is recordings ("sources"), and a third contains links between the two. Each record in songs has a unique ID, LRN. Each record in sources has a unique ID, acqno. Suppose a particular song has LRN 294 and appears on acqno 101, 252, and 747. This would be contained in the links table.
    LRN Acqno
    294 101
    294 252
    294 747
    etc.

    My problem is that I have a data entry form that pulls up an individual record within songs, and then I want to "Add new recording," which is to say, I want to add a new record to the links table that contains the LRN for the CURRENT record in songs and then be prompted to manually enter an acqno (referring to a new source that has just been added).

    I seem to have at best a vague idea how to do this part. I have created a macro called AddLink that the "Add new recording" button activates, but all I get are error messages.

    Any ideas?
    Last edited by bellczar; 02-02-13 at 17:36.

  2. #2
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    994
    Provided Answers: 2
    If you have defined relationships between the tables, the Jet engine will handle updates to the intersection table on its own. I used to have a library database that worked in a similar way, linking authors and books via an intersection table, and I didn't have to write anything special for that to work. However, I think that the data for the intersection table was displayed in the data entry form via a subform. This might be the stage that you are missing.
    10% of magic is knowing something that no-one else does. The rest is misdirection.

  3. #3
    Join Date
    Feb 2013
    Posts
    4
    Thanks, weejas. I did what you suggested and now have a functional form, with one drawback. When I initially click on the intersection table, I get an error message that says "The object doesn't contain the Automation object 'links.' 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."

    Once I dismiss the pop-up message, it works fine. How can I eliminate the error message altogether.

    Thanks. Tony

  4. #4
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    994
    Provided Answers: 2
    Sorry, no idea. Never encountered that message. Have you perhaps deleted a control that is referred to by another?
    10% of magic is knowing something that no-one else does. The rest is misdirection.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •