Results 1 to 9 of 9
  1. #1
    Tempuser is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2009
    Posts
    15

    Exclamation Merging data from multiple Tables to one table

    Hi!



    I want to design a database for 14 users with individual access only to thier data.The catch is i want the data entered by all 14 users to reflect in one database.I tried to use update query but I succeeded in merging two tables only..

    any help is highly appreciated.

    Thank you.

  2. #2
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Why have they got individual tables? Can you not use a FE BE setup? or are the systems stand alone with no network communication?

    David

  3. #3
    Tempuser is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2009
    Posts
    15
    Quote Originally Posted by dcrake View Post
    Why have they got individual tables? Can you not use a FE BE setup? or are the systems stand alone with no network communication?

    David
    Thanx David,

    but what I require is that when these 14 users enter thier data into thier respective tables all these entries must reflect in the 15th table

  4. #4
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    I understand what you are saying, I'm just saying why? Surely if you had one table you could include the owner of the record as a FK. You must have this implemented in the 15th table as how do you know where it came from?

    Again are all the 14 users networked or not?

    David

  5. #5
    Tempuser is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2009
    Posts
    15
    Quote Originally Posted by dcrake View Post
    I understand what you are saying, I'm just saying why? Surely if you had one table you could include the owner of the record as a FK. You must have this implemented in the 15th table as how do you know where it came from?

    Again are all the 14 users networked or not?

    David
    Hi David , many thanks for your help

    I have 14 users with the same data as mentioned below:
    (Sr No
    Account Handled by
    Customer Name
    Customer requirements
    OrderDate
    Customer contract start date
    customer region) what I want is the individual user must have edit rights only to his records and readonly access to the remaining 13 users details.Can u help with some other solution how should I proceed.Your help in this regards is appreciable

  6. #6
    Tempuser is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2009
    Posts
    15
    [QUOTE=Tempuser;10286]Hi David , many thanks for your help

    I have 14 users with the same data as mentioned below:
    (Sr No
    Account Handled by
    Customer Name
    Customer requirements
    OrderDate
    Customer contract start date
    customer region) what I want is the individual user must have edit rights only to his records and readonly access to the remaining 13 users details.Can u help with some other solution how should I proceed.Your help in this regards is appreciable
    all the users are in a network

  7. #7
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Do your users have to log into the application using a username and password?

    If so, when the user brings a record to the screen the edit option should be set according to who is the owner of the record.

    David

  8. #8
    Tempuser is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2009
    Posts
    15
    Thanx dcrake,

    Users have to log into the application using a username and password.

    I need ur help on how to proceed.

  9. #9
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    Ok When you create the parent record or any other table that visislbe to the user then you need to have addtional fields in the table such as:

    DateCreated
    CreatedBy
    LastUpdatedDate
    LastUpdatedBy

    In these fields you would record the username or the primary key form your users table. Then in your forms or in any queries that include the parent table filter them to be for that user only.

    So for example:
    Jon Smith logs in as JSmith in the users table his Primary Key = 5

    TblUsers
    UserId:5 - PK
    UserName:JSmith
    Password:***

    TblSales

    SalesId:1 - PK
    CustomerID: 33 - FK
    .....
    CreatedBy:5
    CreatedDate: 01/01/2009
    UpdatedBy:5
    UpdatedDate: 01/10/2009


    Next Create a Public Variable in a standard module

    Code:
    Public LngUser As Long

    Next create a Public function in the same standard module

    Code:
     
    Public Function MyCurrentUser() As Long
       MyCurrentUser = LngUser
    End Function

    Now when the user logs into the application and their username and password is verified you pass the users id to the LngUser variable

    LngUser = DLookup("UserID","TblUsers","Username='" & Me.LoginName & "'")

    This will remain available throughout the life of the session.

    Now lets say they open a form that displays all the sales made by Jon Smith. The forms RecordSource on an underlying query Called QrySales.

    If you then go to the design of the query and bring down the CreatedBy field and in the condition underneath the CreatedBy column enter

    =MyCurrentUser()

    The query will only display sales for Jon Smith (Pk = 5)

    This can be repeated anywhere in the system wher e filtering is required.

    There is a more consice example of this in the sample databases section.

    Using Public Variables.

    David

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

Similar Threads

  1. Table related to multiple tables by single ID
    By MrTumnus in forum Access
    Replies: 1
    Last Post: 11-17-2009, 02:05 PM
  2. From with multiple tables
    By Darth_Katarn in forum Access
    Replies: 1
    Last Post: 09-23-2009, 08:17 AM
  3. Merging
    By bailey537 in forum Queries
    Replies: 0
    Last Post: 07-14-2009, 04:14 AM
  4. Merging values in Access
    By jains in forum Forms
    Replies: 0
    Last Post: 06-08-2009, 09:31 PM
  5. using COUNT for multiple tables
    By kwalt in forum Programming
    Replies: 1
    Last Post: 02-17-2009, 04:05 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