Results 1 to 5 of 5
  1. #1
    KWHAT is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    15

    How to make an update query

    I have a table with five fields,

    | Zip code | Data 1 | Data 2 | Data 3 | Code |

    The Data 1, 2, and 3 can have duplicates, so my goal is to gather all three fields and find the unique rows and assign a code to them, therefore they can reflect it to all the other row in the table

    | Data 1 | Data 2 | Data 3 | Code |
    | __A__ |__ B__ |__ C__ |_ C1_ |
    | __A__ |__ B__ |__ C__ |_ C1_ |
    | __A__ |__ B__ |______ |_ C2_ |
    | __A__ |__ B__ |__ C__ |_ C1_ |
    | __A__ |__ B__ |______ |_ C2_ |

    What I have tired so far is I created a query which selected all unique rows for the list of tables I just dont know how to assign it a code can anyone help me? If my explanation needs more detail please let me know, Thank you!

  2. #2
    dblife's Avatar
    dblife is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    South Shields, UK
    Posts
    104
    Not sure I understand enough - can you elaborate on what we need to do here?
    Sounds a though you need to write a query or some VBA to sit behind a form but until we know a little more about the application other than field or data I am not sure I can help..

  3. #3
    KWHAT is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    15
    Sure say this is my table and its data below i have tones of records like this so there are many duplicate data for fields [data 1], [data2] and [data 3]

    Zip | Data 1 | Data 2 | Data 3 | Code |
    123 | __A__ |__ B__ |__ C__ |_____ |
    234 | __A__ |__ B__ |__ C__ |_____ |
    456 | __A__ |__ B__ |______ |_____ |
    678 | __A__ |__ B__ |__ C__ |_____ |
    981 | __A__ |__ B__ |______ |_____ |

    my goal is to find the matching row values so i have a set of unique row from them (which i created by a query this gave me )

    | Data 1 | Data 2 | Data 3 | Code |
    | __A__ |__ B__ |__ C__ |_____ |
    | __A__ |__ B__ |______ |_____ |

    What i wanted to do with this was just enter a code value in that query so it reflects on the existing table and displays the code in all duplicate values ,

    so say i enter this data in the query,( which i cannot enter for some reason )

    | Data 1 | Data 2 | Data 3 | Code |
    | __A__ |__ B__ |__ C__ |__C1__ |
    | __A__ |__ B__ |______ |__C2__ |

    i want the following output in the table


    Zip | Data 1 | Data 2 | Data 3 | Code |
    123 | __A__ |__ B__ |__ C__ |__C1__ |
    234 | __A__ |__ B__ |__ C__ |__C1__ |
    456 | __A__ |__ B__ |______ |__C2__ |
    678 | __A__ |__ B__ |__ C__ |__C1__ |
    981 | __A__ |__ B__ |______ |__C2__ |

    Was this better detailed :S i hope so.

  4. #4
    dblife's Avatar
    dblife is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    South Shields, UK
    Posts
    104
    So you have created a select query to show the results you want.
    It appears you are wondering how to search for multiple criteria in a select query.
    If you are using the QBE grid to make the query, there are multiple rows for entering criteria. Placing criteria one below the other, could make the query look for 'c1' or 'c2'

  5. #5
    KWHAT is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Dec 2011
    Posts
    15
    Quote Originally Posted by dblife View Post
    So you have created a select query to show the results you want.
    It appears you are wondering how to search for multiple criteria in a select query.
    If you are using the QBE grid to make the query, there are multiple rows for entering criteria. Placing criteria one below the other, could make the query look for 'c1' or 'c2'
    Ive created the query now i want to create a form based on this query so when i add the new codes in this query i want it to changed in the original table.

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

Similar Threads

  1. How to make a button on a form update report
    By Enemee in forum Programming
    Replies: 1
    Last Post: 07-05-2011, 11:24 AM
  2. How to make an Update Query
    By cd3atm in forum Queries
    Replies: 1
    Last Post: 12-06-2010, 02:43 PM
  3. How to make update to database???
    By skocev in forum Access
    Replies: 2
    Last Post: 03-31-2010, 02:47 PM
  4. Replies: 6
    Last Post: 03-27-2010, 11:18 AM
  5. warning to make update note
    By ga3la in forum Access
    Replies: 1
    Last Post: 01-30-2010, 09:51 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