Results 1 to 6 of 6
  1. #1
    sdc1234 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    89

    Simple Update Query

    Greetings:

    I am at a bit of a loss here any help would be appreciated: I have a VOUCH table that I have inserted 2 blank fields into which are Cadre and Salary, what I wanna do is update the columns with the cadre and Salary tab from another table, ALL EMP table.

    every time I run the update tab It is deleting all the information out of my EMP table, and no I am not clicking on the delete table function either, the reason for the update is that the data source is changing all the time..
    any ideas...

    vr
    novice

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    My suggestion would be to not have the Cadre and Salary fields in the VOUCH table at all; they are redundant. All you need to do is join the VOUCH and Emp tables in a query using (presumably EMp Number or some such), and then use the query when you need to.

    I am assuming there IS a common field between the two tables, e.g. Emp No?

    HTH

    John

  3. #3
    sdc1234 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    89
    I do the last name and ssn but when i try and link the tables the query shows up comes up blank...i then try to change the relationship and still blank




    Quote Originally Posted by John_G View Post
    Hi -

    My suggestion would be to not have the Cadre and Salary fields in the VOUCH table at all; they are redundant. All you need to do is join the VOUCH and Emp tables in a query using (presumably EMp Number or some such), and then use the query when you need to.

    I am assuming there IS a common field between the two tables, e.g. Emp No?

    HTH

    John

  4. #4
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Can you post the fields in VOUCH and the fields in Emp, or better, can you post a screenshot of your query design, showing the relationships? That would help.

    Thanks

    John

  5. #5
    sdc1234 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    89
    when i ran it like this i get a bunch of duplicates
    Click image for larger version. 

Name:	image002.jpg 
Views:	3 
Size:	26.1 KB 
ID:	16169

  6. #6
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    What do you mean by "a bunch of duplicates"? Are you getting more rows in the query results then there are in either of the two tables?

    Lastname is not a good field to be making a join on - there could easily be more than one employee with the same last name. Try using SSN for the join - you know that one is unique in the employee table, and should give you the results you want.

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

Similar Threads

  1. Update in Simple Join Query
    By drunkenneo in forum Queries
    Replies: 3
    Last Post: 11-21-2013, 11:35 AM
  2. Replies: 6
    Last Post: 09-11-2013, 11:32 PM
  3. Replies: 1
    Last Post: 05-08-2013, 07:08 PM
  4. Simple Update Query
    By guygodwin in forum Queries
    Replies: 1
    Last Post: 02-16-2012, 10:59 PM
  5. Simple Update SQL
    By DADAZHU in forum Programming
    Replies: 4
    Last Post: 12-08-2011, 05:22 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