Results 1 to 6 of 6
  1. #1
    skg is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2011
    Posts
    7

    Primary Key Problems

    I have created a database using autonumber fields for the primary key. For example I have a Vendor table with an ID field and a Vendor Name Field.



    When I link the vendor table to, let's say, an Invoice table I link the primary key, but set the Vendor Name field to be displayed.

    The problem is that when I run reports, queries, and export, the primary key is displayed instead of the Vendor name. Is there a fix for this?

    Thanks in advance.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    yes there is, but with this little information it's impossible to analyze it and give you anything to work with.

    got anything else, like details perhaps? the only thing to really infer here is that it's a problem with a multi-column control somewhere.

  3. #3
    skg is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2011
    Posts
    7
    I am creating a purchase order database. I created the following tables.
    tblPOData
    tblVendor

    tblVendor's Primary Key is VendorID(autonumber field)
    tblPOData has a VendorName field. I used the lookup wizard in table design to link tblVendor to tblPOData. When it asked which value I wanted to store I selected VendorName so that VendorName would appear in the table or on forms instead of VendorID.

    The problem is that when I run a query or report the value that displays is VendorID not VendorName.

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by skg View Post
    I used the lookup wizard in table design to link tblVendor to tblPOData.
    most likely, that's the problem. I'd change it right now, before the complexity grows. drop that, and link the two on vendor ID, which is the correct way to do it anyway.

    Quote Originally Posted by skg View Post
    When it asked which value I wanted to store I selected VendorName so that VendorName would appear in the table or on forms instead of VendorID.
    See....right there is a perfect example of how these wizards can simplify your life but not offer disclosures to you as how they work their magic.

    Quote Originally Posted by skg View Post
    The problem is that when I run a query or report the value that displays is VendorID not VendorName.
    what's the basis for your report? statement? query? whatever it is, please post it in a code window for us. that'll tell more than words.

  5. #5
    skg is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2011
    Posts
    7
    I am not sure how to post the code for this query.

    I want to run a report that displays only approved and proposed projects. So two tables are involved
    tblProjects (Child field ProjectStatus)
    tblProjectStatus (Primary Key field StatusID)

    The StatusID field is an autonumber.

    When I run the report it displays the StatusID instead of the ProjectStatus

    If this information is not enough please explain how to post the code for this query.

    Thanks

  6. #6
    skg is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2011
    Posts
    7
    I managed to solve this problem by setting up the query correctly.

    I was using the field ProjectStatus from tblProjects in my query which naturally has the StatusID field stored in it.

    Instead I used the field ProjectStatus from tblProjectStatus.

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

Similar Threads

  1. Replies: 6
    Last Post: 02-19-2010, 03:52 PM
  2. Primary Key Issue
    By Ciwan in forum Access
    Replies: 5
    Last Post: 10-23-2009, 10:04 PM
  3. Primary Key Help
    By phoenix13 in forum Access
    Replies: 4
    Last Post: 07-30-2009, 12:36 PM
  4. about the primary key!
    By Yuesko in forum Access
    Replies: 1
    Last Post: 05-29-2009, 04:20 PM
  5. reset primary key
    By emilylu3 in forum Access
    Replies: 1
    Last Post: 12-09-2005, 03:27 PM

Tags for this Thread

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