Results 1 to 4 of 4
  1. #1
    oakoen is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2009
    Posts
    15

    Update question

    I have 2 tables.
    customer and service that are joined.
    Customer has fields companyname and id(pk).
    Service has fields companyname(lookup of name from customer table) and cust_id(joined to id in customer)

    I have a form which uses the table service. The form uses field companyname to lookup and select a customer.

    How to I get the ID(from customer) to populate cust_id(service) to update automatically when companyname is selected in service?
    I hope I made that understandable.
    Thanks for any help
    Last edited by oakoen; 08-28-2009 at 06:57 AM.

  2. #2
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    For a start do not use the word Name as a name of a field in a table. This is an Access reserved word. You need to be looking at reserved words and naming conventions. This may be the root of your problem.

    David

  3. #3
    oakoen is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2009
    Posts
    15
    I wrote "name" to shorten the post. I have edited my previous post

  4. #4
    dcrake's Avatar
    dcrake is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    435
    How is your relationship set up?

    Is it a one to one
    who is the parent

    From what I gather customers can belong to compainies

    So you should have a table of companies
    A table of customers with a FK back to the Companies PK

    Then your services has a FK back to the PK in the customers table. So by selecting the customer it will automatically know which company they belong to. Assumiong that one customer can only belong to one company.

    David

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

Similar Threads

  1. update query question
    By blusk06 in forum Queries
    Replies: 3
    Last Post: 05-30-2008, 05:55 AM

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