Access 2003: Update table field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Umoja
    New Member
    • Nov 2006
    • 24

    #1

    Access 2003: Update table field

    Hi Guys,


    This is a follow up question from my previous post which Nico5038 help me solved. I have a tblMain which contains (ID-Autonumber, Acct, Number, User). TblMain currently does not have users listed/assign.
    I have TblUsers (ID, UserName). From TblMain I created a query (Qry_Distributi on) which allows me to distribute the accounts evenly among 4 users.
    I would like to know how to update the [User] field in [TblMain] with the [UserName] for the accounts that user was assign. I hope that makes sense.
    In the past I usually append the information to another table. I tried an update query but had no luck. Any input or reference would be greatly appreciated.

    Thank you
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    I would use the ID-Autonumber field with the MOD 4 + 1 to update the UserID.
    When your users have an ID = 1, 2, 3, 4 this should do the trick:

    [code=sql]
    UPDATE tblMain SET UserID = ID-Autonumber MOD 4 + 1;
    [/code]

    Nic;o)

    Comment

    • Umoja
      New Member
      • Nov 2006
      • 24

      #3
      Thanks nico5038 for all your help.

      Comment

      Working...