Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228

    Append and update


    This is a continuation from the problem described here:

    https://www.accessforums.net/showthread.php?t=58337

    Im following a few guides/tutorials but I can't achieve what I want. Before I make this too complicated Just getting the basics right would help. I can then work from there.

    This relates to one table. The "jobs" table contains a field called "Job_Notes". I have other test tables and other methods of gathering notes, but for the purpose of this we can asssume thats all I have.

    I want the user to input notes into a blank form, then these notes to be added to that field when the user has finished. Basically I need the new information to be appended to the existing and then that field should be updated. This can be done through another table I just cant get it to work. If anyone has a sugestion or a reference to somthing I would appreciate it.

    Thanks!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    after user enters data and hits save button, execute an append query using the record key.
    docmd.openquery "quPostNote"

    the sql of which would be like
    update table set [NoteField] = [NoteField] & txtBox where [key] = txtKey

  3. #3
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    I've been on this all day and I'm still clueless. This is the SQL code.

    Code:
    INSERT INTO JobT ( Job_Notes )
    SELECT z_append_1.[append_1] & " " & [job_notes] AS test
    FROM JobT INNER JOIN z_append_1 ON (JobT.Job_ID = z_append_1.Job_ID) AND (JobT.Job_ID = z_append_1.Job_ID)
    WHERE (((z_append_1.Note_ID)=[Forms]![z latest]![z_append_1 Subform].[Form]![Text4]));
    I CAN get the data I want in the query but if the query is closed when I press the command button, I get a message that says It cant add the record because of a key violation.

    But even having the data in the query (when its open) isnt enough. I need it to update the table.

    Im sure its not meant to be this hard but it's one of the most difficult things ive done in access haha. If you could offer any more help i would appreciate it.

  4. #4
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Im not moving any data relating to primary or secondary keys so how is there a key violation :/

  5. #5
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    done it! only tood a week

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

Similar Threads

  1. Update existing and append new
    By krausr79 in forum Access
    Replies: 2
    Last Post: 10-29-2015, 10:03 AM
  2. Best way to append and update records
    By saudkazia in forum Queries
    Replies: 3
    Last Post: 10-06-2015, 03:51 PM
  3. Replies: 3
    Last Post: 03-11-2012, 03:35 PM
  4. Update or Append Query
    By Ran in forum Access
    Replies: 8
    Last Post: 01-06-2012, 12:15 PM
  5. Append/Update Query -- Need Help!
    By su-san in forum Queries
    Replies: 12
    Last Post: 11-08-2010, 12:52 PM

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