Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    77

    Unanswered: juz a simple question to Access pros.

    hi ppl,

    juz wanna ask if it is possible to use this code: DoCmd.GoToRecord , , acNewRec, after i have juz executed an append query?

    thx in advance.

  2. #2
    Join Date
    May 2004
    Posts
    1
    Yes it is possible to use DoCmd.GoToRecord , , acNewRec, but this will bring you to a new post after the appended post. If you want to go to the just appended post you should use DoCmd.GoToRecord , , acLast

  3. #3
    Join Date
    Mar 2004
    Posts
    77
    but now I've got this form which is bounded to one table. in turn, this table have 2 lookup values within it. after i have use append query to add in information and tried to go to a new record, Access will tell me that i can't go to the specified record. Furthermore, when i tried to edit the form after i've executed the append query, Access will tell me that I can't change or add records because a related record is required in another table. I've added in the screenshots of these errors. pls help. thx
    Attached Thumbnails Attached Thumbnails error1.bmp   error2.bmp  

  4. #4
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    The "related record" error is generally a result of a "parent/child" inwhich an orphan is about to be created. Are you sure you only have one table impacted by your changes? It sounds like there are relationships setup on the database, and you are trying to add a record to the child table. Since there isn't a matching record on the parent table, it gives you the "related record" error.

    Another thing that may be of importance: you may need to insert a "requery" after you execute the append query so that the form gets to see the new data (which may help the other error). After a form is opened, it does not always catch changes made to the underlying data by other processes.

    The context is: Me.Requery
    Insert this code after the update query and before the GotoRecord command.

    Good luck.

  5. #5
    Join Date
    Mar 2004
    Posts
    77
    thx for the help. i will try out the method u have suggested.

Posting Permissions

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