Results 1 to 4 of 4
  1. #1
    fishhead is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    167

    simple update query

    Hi i'm having trouble getting my head around the proper way to create/update a record.

    I used to create two forms (form 1 would have part of the data that i wanted to update in form 2)

    Now what i would like to do is use the update query feature to do this but i'm not sure how to set this up.


    qSupplierPymtTerms returns 4 fields - 2 of which have data i want to use
    field :autonumber
    field : credit terms

    qAPPaymentDates has 4 fields - 2 of which i will be updating by qSupplierPymtTerms

    qAPPaymentDates is an update query
    first question. How do i update a new record only ? I don't want to update all the other records in this query?

    Once this is sorted out i want to update qAPPaymentDates query as follows:
    FIELD qAppaymentDates[AP Costs Autonumber] update to qSupplierPymtTerms[autonumber]
    FIELD qAPPaymentdates[AP Paid Date] update to Date()+qSupplierPymtTerms[Credit Terms]

    Can someone please point me in the right direction?

    thanks in advance

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Terminology - a new record is one that hasn't been finished yet. In fact, it may not even have been started. You append new records; you update existing ones. You really can't update a new record. If by that you mean one that you've just created, then it's not a new record - it has the same "newness" as any other record. It might be distinguishable based on a create date/time, or many developers might rely on the greatest autonumber id to tell then which is the latest record.

    So if this isn't what you're needing, then the reason is because of my misunderstanding of the terms you used...
    You prevent updating of all existing records by providing criteria in the query that will restrict the records, and if possible, you join the two tables on a common field where at least one of them is unique. Since I can't see the tables, nor did you specify what the 4 fields are in the 2nd query, that's the best I can offer for now; except to say, experiment on table copies.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    I agree with Micron's comments. As he said, there may be some terminology/concept issues. It might be helpful if you could give us an example in plain English showing some values in the various tables, and what the intended final result should be. Remember, we don't know your application nor database design, so samples or specific uery SQL and table designs will help communications.
    Good luck.

  4. #4
    fishhead is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2015
    Posts
    167
    Thanks for the feedback. let me review this more accurately.

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

Similar Threads

  1. Replies: 3
    Last Post: 12-09-2015, 11:11 AM
  2. Simple Update Query
    By sdc1234 in forum Queries
    Replies: 5
    Last Post: 04-16-2014, 02:01 PM
  3. Update in Simple Join Query
    By drunkenneo in forum Queries
    Replies: 3
    Last Post: 11-21-2013, 11:35 AM
  4. Replies: 6
    Last Post: 09-11-2013, 11:32 PM
  5. Simple Update Query
    By guygodwin in forum Queries
    Replies: 1
    Last Post: 02-16-2012, 10:59 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