How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask Chris L. Your Own Question

Chris L.
Chris L., Support Specialist
Category: Microsoft Office
Satisfied Customers: 3875
Experience:  Certified Expert with over 10 years experience.
Type Your Microsoft Office Question Here...
Chris L. is online now
A new question is answered every 9 seconds

I have an Access database I created years ago. In order to

Resolved Question:

I have an Access database I created years ago. In order to improve it, I would like to establish some composite primary keys rather than continue using the existing primary key, which right now is an automatically generated number field. When I try to create the composite key, it says I need to remove some relationships that exist with other tables. I'm not sure what this would mean. I suspect I need to remove the existing primary key, but fear I would mess up my existing database by doing that. One example of some related tables I have are Invoice, Jobs and Vendors. When I enter data into an invoice form, I'd like a composite primary key that would include Job, Vendor, Invoice Number and Date. The Date and Invoice Number are a field in the Invoice table. The Job and Vendor are linked to the Job and Vendor tables. By establishing the composite primary key, I could have an invoice from a vendor that had items for more than one job on it, so I could have duplicates of the invoice number on invoice records, and a unique value in the job field would separate it.

I hope I'm being clear here. I'd appreciate any help you could give me.
Submitted: 2 years ago.
Category: Microsoft Office
Expert:  Chris L. replied 2 years ago.
Hello and thank you for using Just Answer.

I believe I understand what you are trying to do, it is a little difficult without actually seeing the database.

Before you start working with the instructions I am about to give, please make a backup/copy of your database.

You should perform the instructions on your copy of the database that way nothing accidentally goes wrong with you main database.

Again perform the following on a copy of your database.


Before you can remove a primary key, you must make sure that it doesn't participate in any table relationships. If you try to remove a primary key for which a relationship exist, Access warns you that you must delete the relationship first.

If the tables that participate in the table relationship are open, close them. You cannot delete a table relationship between open tables.
On the Database Tools tab, in the Show/Hide group, click Relationships.

If the tables that participate in the table relationship are not visible, on the Design tab, in the Relationships group, click Show Table. Then select the tables to add in the Show Table dialog box, click Add, and then click Close.

Click the table relationship line for the table relationship that you want to delete (the line appears bold when it is selected), and then press the DELETE key.
On the Design tab, in the Relationships group, click Close.

In the Navigation Pane, right-click the table from which you want to remove the primary key and then click Design View on the shortcut menu.
Select the current primary key field.

If the primary key consists of multiple fields, click the row selector for any field in the primary key.
On the Design tab, in the Tools group, click Primary Key.

The key indicator is removed from the field or fields that you previously specified as the primary key.

Please Note: When you save a new table without setting a primary key, Access prompts you to create one. If you choose Yes, an ID field is created that uses the AutoNumber data type to provide a unique value for each record. If your table already includes a AutoNumber field, Access uses that field as the primary key.

Select the field or fields that you want to use as the primary key.
To select more than one field, hold down CTRL while you click the fields.

On the Design tab, in the Tools group, click Primary Key.
A key indicator appears to the left of the field or fields that you specify as the primary key.

Press CTRL+S to save your table design changes.

If this does not help or is not what you are looking for please reply and let me know, otherwise please click the accept button.

Thank You
Customer: replied 2 years ago.
I understand your instructions. What I'm not sure of is whether or not the relationships between tables will re-establish themselves using the new composite primary key after I set them up. I would like to be able to query the database and have access to all the records I've entered under the old primary key.
Expert:  Chris L. replied 2 years ago.
You will need to reestablish the relationships/querys after changing the primary key. Im on a train right now so if you can give me a little time I will respond further.
Thanks I will be back online in a few hours
Expert:  Chris L. replied 2 years ago.
Ok I thought about this a bit more.

What I would suggest you try on your testing(copy) of the database if to either, remove the relationships and try and create the composite keys In table design mode, select first key field, hold the control key and select the second key field etc... With fields selected, click the key icon to add a key.

Hope this helps.
Chris L., Support Specialist
Category: Microsoft Office
Satisfied Customers: 3875
Experience: Certified Expert with over 10 years experience.
Chris L. and 10 other Microsoft Office Specialists are ready to help you
Customer: replied 2 years ago.

I will try your suggestion. It may take me a day or so as I'm busy right now, but I'll get back to you as soon as I determine if this works.

 

Thanks.

Expert:  Chris L. replied 2 years ago.
No problem take your time and good luck.
Customer: replied 2 years ago.

I'm sorry it's taken me a while to follow through on this issue. Turns out it is more involved than just manipulating relationships and keys. I have some blank fields in a lot of the records that already exist and before I can set those fields as primary keys, I need to either delete those records or fill those fields. So, I have some work to do before I can fully deploy the fix. However, I believe I'm on the right track and will accept your answer and then probably get back to you for more guidance.

 

Thanks

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
< Last | Next >
  • My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed. One Happy Customer New York
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
 
 
 

Meet The Experts:

 
 
 
  • jstinehelfer

    Information Systems Manager

    Satisfied Customers:

    36
    A+ Comptia Certified computer repair
< Last | Next >
  • http://ww2.justanswer.com/uploads/JS/jstinehelfer/2012-6-6_215146_Pictureofme1.64x64.png jstinehelfer's Avatar

    jstinehelfer

    Information Systems Manager

    Satisfied Customers:

    36
    A+ Comptia Certified computer repair
  • http://ww2.justanswer.com/uploads/JA/JasonJames122/2011-12-16_135647_jasonjamesheadshotweb.64x64.jpg JasonJames122's Avatar

    JasonJames122

    Computer Enthusiast

    Satisfied Customers:

    0
    I manage all information systems (network of Windows PC's and servers with Microsoft Office products) for a small business
  • http://ww2.justanswer.com/uploads/JE/jessmagz/2012-6-6_18129_jm.64x64.jpg Jess M.'s Avatar

    Jess M.

    Computer Support Specialist

    Satisfied Customers:

    301
    Computer Software Specialist for more than 10 years
  • http://ww2.justanswer.com/uploads/CH/chutz747/2011-11-6_14231_me.64x64.jpg The-PC-Guy's Avatar

    The-PC-Guy

    Computer Manager

    Satisfied Customers:

    274
    20 years experience providing remote computer support
  • http://ww2.justanswer.com/uploads/SP/spherrod/2012-6-6_174244_1000852.64x64.JPG Steve Herrod's Avatar

    Steve Herrod

    Computer Support Specialist

    Satisfied Customers:

    125
    Trained in Microsoft Office from 2000 through to latest version 2010.
  • http://ww2.justanswer.com/uploads/SE/Seashore2011/2011-12-6_33418_111205223015.64x64.jpg Chris L.'s Avatar

    Chris L.

    Support Specialist

    Satisfied Customers:

    124
    Certified Expert with over 10 years experience.
  • http://ww2.justanswer.com/uploads/KR/krkljatorm/2012-6-24_153417_ITMiro.64x64.jpg IT Miro's Avatar

    IT Miro

    Computer Scientist

    Satisfied Customers:

    97
    Bachelor's Degree in Information Technology, Microsoft Certified Professional