Results 1 to 7 of 7
  1. #1
    Join Date
    May 2006
    Posts
    178

    Unanswered: An Analytical Problem

    Guys,

    I need your help on a little problem.

    I have two tables TblMaster and TblLatest.

    I want to update TblMaster with certain fields from TblLatest and also add any additional records that do not exist in TblMaster. They both have primary keys that will identify the records.

    The fields i want to update are called "Codes" and "OtherCodes". Can someone help me. I have attached the 2 sample tables so you can understand what i mean.

    Thanks

    Aboo
    Attached Files Attached Files

  2. #2
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    In the attached file there are two queries. One for the appending of new records the other one is for your update.

    NOTE: I changed the data type of ID in both tables to a number. Personally, I do not use a field with a data type Autonumber as a Primary Key due to the numbering may get out of sync.
    Attached Files Attached Files

  3. #3
    Join Date
    May 2006
    Posts
    178
    Thanks Poppa Smurf,

    I take it this is a standard Access function? yes you were right about the primary key. I put the table together as an example and forgot about that.

    One more question, say if i wanted to remove all records that contained the firstname as Harry. How would i resolve that?

    Again thanks for your help.

    Also


    Aboo
    Last edited by aboo; 04-01-09 at 03:41.

  4. #4
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    You would use a DELETE query and in the criteria of the Firstname you would put "Harry"

  5. #5
    Join Date
    May 2006
    Posts
    178
    Thanks Pops!

    Yet another question, can i put a multiple criteria, like "Harry,Jim,Terry" or do i need to seperate them?

    Aboo

  6. #6
    Join Date
    Jun 2007
    Location
    Maitland NSW,Australia
    Posts
    388
    You could put "Harry" and "Jim" and "Terry" in the criteria.

  7. #7
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Actually it would be "Harry" or "Jim" or "Terry". Nobody would have all three names!!
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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