Please Help with Multiple Field Primary Keys

I have two tables in a database that have to use four fields for a unique 
identifier and primary key.  How do I set up a query to set a relationship 
between those four fields together as one?  When I add the tables to the 
query I see the fields, but I am not having any success properly setting the 
relationships.  
0
Utf
3/6/2008 3:20:00 AM
access.queries 6343 articles. 1 followers. Follow

2 Replies
638 Views

Similar Articles

[PageSpeed] 42

The upper half of the query design window is where the 2 tables appear.

Drag Field1 from Table1, and drop it into Field1 from Table2.
Access displays a join line from one table to the other.

Drag Field2 from Table1, and drop it into Field2 from Table2.
Repeat for the other 3 fields.

Note that is has only set up a JOIN in your query. It does not create 
relationships between the tables. To do that, choose Relationships on the 
Database Tools tab of the ribbon (Access 2007), or on the Tools menu in 
earlier versions.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"ridgerunner" <ridgerunner@discussions.microsoft.com> wrote in message
news:195EC538-5055-48B3-A005-04EF95A9BEDA@microsoft.com...
>I have two tables in a database that have to use four fields for a unique
> identifier and primary key.  How do I set up a query to set a relationship
> between those four fields together as one?  When I add the tables to the
> query I see the fields, but I am not having any success properly setting 
> the
> relationships. 

0
Allen
3/6/2008 3:29:53 AM
Thank you so much Allen.  This is very helpful.

"Allen Browne" wrote:

> The upper half of the query design window is where the 2 tables appear.
> 
> Drag Field1 from Table1, and drop it into Field1 from Table2.
> Access displays a join line from one table to the other.
> 
> Drag Field2 from Table1, and drop it into Field2 from Table2.
> Repeat for the other 3 fields.
> 
> Note that is has only set up a JOIN in your query. It does not create 
> relationships between the tables. To do that, choose Relationships on the 
> Database Tools tab of the ribbon (Access 2007), or on the Tools menu in 
> earlier versions.
> 
> -- 
> Allen Browne - Microsoft MVP.  Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
> 
> "ridgerunner" <ridgerunner@discussions.microsoft.com> wrote in message
> news:195EC538-5055-48B3-A005-04EF95A9BEDA@microsoft.com...
> >I have two tables in a database that have to use four fields for a unique
> > identifier and primary key.  How do I set up a query to set a relationship
> > between those four fields together as one?  When I add the tables to the
> > query I see the fields, but I am not having any success properly setting 
> > the
> > relationships. 
> 
> 
0
Utf
3/6/2008 1:05:02 PM
Reply:

Similar Artilces:

MS or 3rd Party way to annotate inbox subject fields?
Thanks for reading -- I have searched and searched, but have found no info. I am looking for a way to add a note or even change the subject fields of my incoming email. I use E-fax, and get a ton of orders faxed to me. The subjects all look the same, though -- Efax from 555-555-1212 (2 pages) It's great because I can store all my faxes forever, but it sucks trying to organize them. In order to find an old fax, I have to go to the approximate date, and then start opening all the attachements. If I could add a note, like "Order for the Smith Job" to the inbox subject view, th...

Access help Urgently!!!!!
Good day. I really need some help! Someone here at our offices deleted a Access database file. I retrieved the file, but now it doesn't want to open!!!!!! It gives me the following error : Unrecognized database format (.mdb) Will someone please let me know what I need to do to make this database to work as soon as possible!!! Thank you Shane shaneo@neda.co.za Shanne, First off I want to let you know that I am not a Msvp but I have run into a simular situation and the Microsoft Jet Comp utility helped me out. Paste the link below to your browser and you can read what it does....

Help: Working With Lists
I would appreciate some help, I have a list of data that consists of text. 2 columns wide, x number of rows down. I would like to copy this list to another sheet, but so the data is visible across 1 A4 sheet High, by X number of A4 sheets in width. ( as many needed to display the data ) I have tried copying this list to another sheet by setting up the print area and pasting to the selected cells, but everytime the list stays in the original format and continues down out of the print area, in the first 2 columns. Many thanks I may not be following you exactly but it sounds as if you migh...

How to add multiple controls in view?
Hi, I am following this example to create controls in my view, as describe here http://dev-www.codeguru.com/atl/windowless.shtml.I can create only one control,how can i create multiple controls in view,I am using this code in OnIniatialUpdate but i can see only one control. By the way i am trying to make designer applicantion like VB/VC resource editor. Regards. dilbir My code ... m_pCtrl = new CWindowlessControl; m_pCtrl2 = new CWindowlessControl; if (m_pCtrl->m_hWnd == NULL) { CRect rect(40, 40, 200, 200),rect2(80,80,200,200); // VERIFY(m_pCtrl->CreateControl("{CE9...

Beware MM 2006 if you have multiple accounts
I have been a money user for years. I just installed mm 2006 and did an online update. When done, money downloaded all accounts that I have access to at all financial institutions and created MM accounts for them. Of course, it ignored the account that previously existed in mm 2004 for those institutions - don't know why and realy don't even care. Apparently, the logic is that if you have an acount at a financial institution then you must manage it through money. You cannot avoid this - you can only close the accounts you don't want to see and eliminate them every time y...

Querying a hyperlink field
Hi all, I need to query my table for empty / null ()?? hyperlink fields. How do I do this? Thanks -- Alaqua 1. Create a query using this table. 2. In query design, drag the hyperlink field into the grid. 3. In the Criteria row under this field, enter: Is Null -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Alaqua" <Alaqua@discussions.microsoft.com> wrote in message news:5F1C2B3F-7EBF-494B-B291-BB1C7D2A111A@microsoft.com... > Hi all, &g...

MFC bug? The cause field is CFileException::none if path is invalid
Based on a quick examination of MFC source codes during debugging a strange behavior of our application I'd say that there's a bug in MFC's CFile::Open method when using VS .NET 2003. I think the bug did not exist in VC++ 6.0. If I try to open a file using CFile's Open method and pass it a path that points to a nonexisting hard disk (e.g. "E:\Test\Test.txt" in my case since I don't have an E drive), the exception object returned by CFile::Open has its m_cause member set to CFileException::none. According to MSDN, this should indicate that no error occurred, and M...

HELP: CToolBar RESOURCE LEAK!?!?
I noticed that everytime I float/dock a CToolBar (or other CControlBar derived class), it leaks 5 to 6 GDI resources. Stepping through MFC code, it seems like SetWindowPos() calls are leaking 2 GDI objects each. Has anyone seen anything like this? It doesn't seem specific to my app as both Spy++ and Wordpad leak when I float / dock the toolbars. Any way to fix this leak? Look at Nishant's reply in the your previous post. Its most likely the cause. ---------- Ajay Kalra ajaykalra@yahoo.com You already may have got the answer. But from a GDI perspective,get hold of Gdiobj.ex fr...

Integration Manager Help!!
We are new to Integration manager and our company is ready to get us some training with classes. However, we cannot decide whether to take a class onsite with a company or have them come onsite and teach it. Does anyone have any recommendations either way?? There are two companies that we have been working with and have heard good recommendations from others but if anyone else has input....please let me know. We are almost tempted to do both because we see advantages to each one. Does anyone have any ideas????? thanks Barb Barb, I've had much success with ebizQ's online...

Quick formula help please
Have I missed something here? =IF(E13>0,"early",E13<0,"late") Cheers!! =IF(E13>0,"Early",if(E13=0,"","late") "Norm" wrote: > Have I missed something here? > =IF(E13>0,"early",E13<0,"late") > > Cheers!! Thanks, E13 is a time value.. if E13 has a value of 12:30 and early is before 12:00 and late is after 12:45 and 12:00 to 12:45 is On Time how would I formula this? Cheers!! "Norm" wrote: > Have I missed something here? > =IF(E13>0,"...

Help About screen shows old version #
I'd like to investigate an oddity. While my office update is at service pack two, my help about screen shows SP1 on it. When I went to bring down SP2 for a second time, thinking it didn't install, the download site said I was at SP2 already. I am confident it installed correctly but I am just curious what may cause that. Thanks ...

Please recommend one freeware to prevent USB flash disk from virus
Sometimes, I plug USB flash disk into various unknown computers. And I don't know if these computers are free from virus or not. What can I do? In news:e7vWm8wzKHA.244@TK2MSFTNGP06.phx.gbl, �� <H> typed: > Sometimes, I plug USB flash disk into various unknown computers. And > I don't know if these computers are free from virus or not. What can > I do? Put the flash disk in a rubber, and DON'T KISS! On Mon, 29 Mar 2010 15:12:04 +0800, "��" <H> wrote: >Sometimes, I plug USB flash disk into various unknown computers. And...

Simple excel macro help
I have recorded a simple macro for data entry that moves to the right several cells, entering info in each and then returning to the starting column. I need to know how to provide for user input at each cell stop across and then when it returns to the starting column to have it loop until data is finished Can anyone provide a simple answer to this? It used to be easy to do this in Lotus way back but I have not done it for a while. Thanks Fred As usual you should post your efforts (not a workbook attachment) for comments and suggestions. You do not have to physically move to each cell to e...

Problem getting rid of "on behalf of name" in the from field
I have an unusual problem... I work for a company that is actually two companies in one. Manufacturing company that makes two different products so as to have two different names. We use Outlook 2000 and our mail is hosted by our ISP (who use a Linux mail server). We have two different email accounts abc@abc.com and xyz@xyz.com . When we go to send email (abc.com being the default account) and we chose the from field and chose xyz@xyz.com the email goes out to the recipient as abc@abc.com on behalf of xyz@xyz.com .. We can not have this because they are two separate companies. It is OK for...

Help-Thread in MDI MainFrame
In MDI application when I try to do as follow in thread controlling function it gives assertion failed for marked statement. I want to highlight active document file line by line & do other stuff. Worker thread is created in MainFrame by passing this as parameter. UINT MyTheradModule(LPVOID pParam) { CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()-> m_pMainWnd; CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame(); //<=error CMyView *pView = (CMyView *) pChild->GetActiveView(); //CMyview is derived from CEditView } Unable to find why it fails.Can anybody help?...

limit Criteria from a date field
I have a field that performs a calcualtion based on a date: Age: ([DATE]-[TR_DATE]). I need to add to the criteria >50 But the error says Arithmatic overflow error, guess because it was a date value to begin with. I tried creating anothe field from that one: Age at Panel: ([Age]>50) which give me a -1 or 0 but I still cannot make the criteria = -1 or 0. I tried another query but it just carries over the same issues. How do I allow only >50 from this calculation???? Dan @BCBS <DanBCBS@discussions.microsoft.com> wrote: >I have a field that performs a calcualtion base...

Multiple email accounts, all send through default account
Hello, I'm using Outlook 2003, SP1 (all officeupdates from MS applied), and have a wacky problem. I have multiple email accounts (POP and IMAP) setup in a single Outlook profile, but regardless of which account I chose to send the message from, it gets sent through my default account. I've tried deleting and rebuilding my Outlook profile, and that didn't make a difference. I've seen vague rumblings of this problem, but was anyone ever able to find a solution to this problem??? ...

Using MapiSendMail, "To" field displays "=SMTP..." instead of Name
I am using Simple MAPI function MapiSendMail from an MFC application (code below if you're interested), and it works as advertised on the machines at my location, but not on my clients' machines. I populate the MapiRecipDesc with the appropriate values for name and address, and when I run the application at my location, the e-mail that gets displayed shows the correct "name <address>" in the "To" box, and it all worbs properly. The string value that I use in the lpszAddress member is correctly formatted as "SMTP:address". When my client runs t...

How do I delete User-Defined Fields
When I open a Contact Form and select the All Fields tab, two of the choices I get are to show "User-Defined Fields in this Item" and "User-Defined Fields in Folder". I've got quite a few of these fields that I no longer need, and I'd like to reduce the clutter. Is there some way I can delete those fields in one fell swoop - that is, not having to go into each individual's contact form and delete them manually? Fields in the items need to be deleted one at a time from each item. You could also write code to automate that, iterating the UserProperties...

Windows XP Update problem help needed..
Am running Operating System : Microsoft Windows XP Home Edition Version : 5.01.2600 Service Pack 3 Problem is that when I go to the Windows update site it shows the following updates available: Microsoft .NET Framework 3.5 SP1 Update for Windows Server 2003 and Windows XP x86 (KB982168) Microsoft .NET Framework 3.5 SP1 and .NET Framework 2.0 SP2 Security Update for Windows 2000, Windows Server 2003, and Windows XP x86 (KB979909) I tryed to install them along with others updates listed and it showed they succeeded along with the others but when I rest...

Runtime error 2495
I converted an Access 97 database to Access 2002. On selecting a combo box Runtime error 2495 - cannot find the field '|' occurs. This does not occur in Access 97. The error occurs in the following event procedure Private Sub MessageId_AfterUpdate () 'Refresh form Me.Requery End Sub I have also tried replacing Me.Requery with DoCmd.RunCommand acCmdRecordsGotoNew and the same error occurs. Any suggestions to fix this problem? ...

(HELP!?!) Sys.WebForms.PageRequestManagerServerErrorException
My site is starting to give the below area for parameters that have worked in the past. Sys.WebForms.PageRequestManagerServerErrorException: String[6]: the Size property has an invalid size of 0. ScriptResource.axd? d=dB4YQkvWDiNssE_JaCTk8mvHoCM0qjfGB7ZsGylBVZIjsaW7Q0ogENtN8ZRU9uIZY4tl-0Q- zZSTsPOyFTrGZeG4luBBAW0_pW5MASgil2WadXfIgKIXmlhzV2eoSF5Q0&t=16ab2387, line 868 character 13 Anyone have any ideas as to might be causing this? It's not the only page. Is it possible for the page itself to become corrupt? ...

Notes field in Data Analysis
Hi, Is there any way whatsoever that I can get the text from the task 'Notes' field to be displayed in Data Analysis views? /Spiro. Hi Spiro, Well, as I say to my customers, everything in a 'puter system is either a 1 or 0, therefore everything is possible. Is it easy to do what you want, no, It would be custom develpment, but it would be easier to write an SSRS report that listed tasks with notes... -- Regards, Ben. http://www.applepark.co.uk http://appleparkltd.spaces.live.com/ "ST" wrote: > Hi, > > Is there any way whatsoe...

Time Entry interface for Field Service
Is Field Service anywhere our only alternative for web based or mobile device based time entry for technicians to clock in / clock out of tasks? It looks like we are faced with a $50,000 investment to setup my 100 technicians to record their time? Maintenance supervisors are too busy to force them to do time entry for all of their subordinates, hoping we are overlooking a system feature or available extension... if not then we will need to research third party alternatives to FS... You should contact I.B.I.S. They wrote the field service series and sold it to Microsoft. -- Charles ...

need help on the best way
I log in what we call bills I have created a form where I log in the amounts. In the form header I have 2 combo boxes to look up information. THis is the part I am unsure if is right or if there is a better way. I have a combo box that I assign a "batch number" 1-8 if I am working on batch 1 when I choose my billing month and choose my provider number it creates a new record and under theMonth it puts the billing month and provider number. But then it needs to refresh with the provider information. If this is not a good way what should I do. I have two tables. tblChild Care...