Same Primary Key in Different Tables

I'm new to Access and using Access 2003.  I'm setting up my tables and have 2 
questions.  1) I have a table for customer names.  I set up Customer ID with 
Autonumber as the primary key.  I want to use Customer ID in another table 
again as the primary key.  Do I set it with Autonumber again or set it to 
Numerial?  2) If I use an input form to create a new customer, how does 
Customer ID actually get created?  Thanks in advance for your help.
0
Utf
1/13/2008 7:47:00 AM
access 16762 articles. 3 followers. Follow

2 Replies
1921 Views

Similar Articles

[PageSpeed] 6

To use the same CustomerID as primary key in another table, use a field of 
type Number.

When you create a relation between your 2 tables (in the Relationships 
window), this will give you a one-to-one relation, since the field is unique 
in both tables.

You do not automatically get a record inserted into the related table when 
you add a new customer to your main table. You can program it in the 
AfterInsert event procedure of the form where you enter customers if you 
have a reason to do so.

Before you get that far, it might be worth considering whether you are 
actually creating a design that is correctly normalized. There are some 
cases where what you are doing could be right, but if you are only doing 
this because Access won't let you have more than 255 fields in your Customer 
table, the design is not right.

-- 
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.

"SactoGal" <SactoGal@discussions.microsoft.com> wrote in message
news:33F12004-6877-4FBB-84C7-F77FE8D98982@microsoft.com...
> I'm new to Access and using Access 2003.  I'm setting up my tables and 
> have 2
> questions.  1) I have a table for customer names.  I set up Customer ID 
> with
> Autonumber as the primary key.  I want to use Customer ID in another table
> again as the primary key.  Do I set it with Autonumber again or set it to
> Numerial?  2) If I use an input form to create a new customer, how does
> Customer ID actually get created?  Thanks in advance for your help. 

0
Allen
1/13/2008 8:37:27 AM
"Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in message 
news:%23TaAK%23bVIHA.4140@TK2MSFTNGP04.phx.gbl...

Lazy. moronic, rude and inconsiderate top-posting fixed.

> "SactoGal" <SactoGal@discussions.microsoft.com> wrote in message
> news:33F12004-6877-4FBB-84C7-F77FE8D98982@microsoft.com...
>> I'm new to Access

> it might be worth considering whether you are actually creating a design 
> that is correctly normalized.

LMAO



0
msnews
1/13/2008 8:43:49 AM
Reply:

Similar Artilces:

microsoft office professional 2007 trial product key
My computor is not accepting the product key,what must i do? From where did you get the product key from -- Peter Please Reply to Newsgroup for the benefit of others Requests for assistance by email can not and will not be acknowledged. "Kaiser" <Kaiser@discussions.microsoft.com> wrote in message news:7C6101C5-A75D-4A84-B48C-992FDA921A70@microsoft.com... > My computor is not accepting the product key,what must i do? He may have stolen it from somewhere. What difference does this make? Has your wife also joined your sister and your mum in the escort ...

what does "you can only type in a text box, table mean?
I can't type on the calendar that I made, the message that comes up says, "you can only type in a text box, table, and certain shapes". I could type in it yesterday, so I don't understand! Please help! LA LA <LA@discussions.microsoft.com> was very recently heard to utter: > I can't type on the calendar that I made, the message that comes up > says, "you can only type in a text box, table, and certain shapes". > I could type in it yesterday, so I don't understand! Please help! This emssage appears when you don't have an object selec...

different templates for each page
is there a way to make a publication that has different templates for different pages? Open two instances of Publisher, in the first instance open your template (are you meaning a pre-designed publication?). Do your edits, copy and paste to the second instance of Publisher. Back to the first, close and don't save, new, open the second template, do your edits, copy and paste to the other publication's page two and so on... -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "james jones" <james jones@discussions...

Union Query with 3 tables
I'm trying to use a Union query with 3 tables to combine the following fields. Not all customers have a territory or broker; however, I would like al lthe customers listed in the output. Thanks for any help Customer Number from table 1 Territory Name from Table 2 Broker from table 3 What you are looking for is not a UNION query. A UNION query merges like data from multiple record sources into a single result set. In my experience, it's most common use is to normalize a poorly structured database. I believe what you want to do is create a query that links your Customer t...

personal folder size showing different #2
Why is personal folder size showing different in outlook and windows explorer. In outlook personal folder properties, it shows 2706KB but in explorer it shows 2500KB. pls help to advise asap. thanks ...

Primary partitions
Say I have four hard drives(physical drives) in one computer. Is the four primary partition per each physical hard drive? In theory than I could have 16 primary partitions in a computer that has four physical drives. Is this statement correct? With Microsoft's partitioning that's correct. There are other utilities that will let you do more than four primary partitions. If your installing Win 7 let it do the partitioning. Win 7 has a 100MB partition for system files and then another primary partition for the rest of Win 7. Win 7, as does Vista, you can shrink...

auto numbering in a table
I have a table with a column using auto numbering for itentification purposes. Now I want to sort it, having the numbers stay the same but I want to turn off the auto numbering. When I do the numbers go away. Anyway to do this? You can convert numbers to text. Select the relevant column and then do the following: Press Alt+F11 to display the Visual Basic Editor. Press Ctrl+G to activate the Immediate window. Type Selection.Range.ListFormat.convertnumberstotext and press Enter. Numbering will be removed from the selected column. (Note that if numbering was applied v...

Forwards acting differently
We are using Outlook 2000, Exchange 2003, and Windows 98 on the troubled computer. A staff member mail recently started packaging forwarded messages in an envelope rather than embedding the text below the message. She swears nothing has been changed on her computer, but this started happening two weeks ago. No one else seems to have this problem. What causes this? How can I change it back to normal for her? -Lauri Microsoft Office Specialist Bellingham School District Tell her to insert as text, not attachment. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the...

How do I create 1 chart from 2 different sheets?
Using Excel 2003 how do I create one pie chart by using data from 2 different sheets? all of the examples i see are created by clicking and dragging data from one sheet. Jon Peltier has instructions for charting data from different sheets: http://www.peltiertech.com/Excel/ChartsHowTo/ChartDataFromDifferentSheets.html tclbeach wrote: > Using Excel 2003 how do I create one pie chart by using data from 2 different > sheets? all of the examples i see are created by clicking and dragging data > from one sheet. -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.cont...

two units on primary Y axis
Hay!! I have spent quite some time looking for a solution and I doubt there is one. Is it possible to have two units on primary Y axis such us for example EUR /USD.. For example primary Y would have values such us : 1000 EUR / 1300 USD, 2000 EUR/2600 USD etc.. If there was a way that custom format would include possibility of calculation for unit.. tnx Rado Hi, Perhaps you can create a fake value axis using a dummy data series plotted as xy-scatter. Display data labels which are linked to cells that have the required text. Data for series would be like, X Y Label 0 ...

Storing values of multiselect box into a table
I'm trying to set up a multiselect box on one of my forms but I'm not familiar with VB code to be able to store and save the values in the table. I've tried searching these forums, but I haven't really found anything that fits my needs (that I know of). Does anyone have any links to online tutorials that could probably help? Or if you know of a thread here that answers my question, could you post the link? Thanks! Kristine -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200707/1 Kristine, a multi-select list box is n...

excel table
I wish to create a simple table and enter numerical data in column B with and automatic total, row by row, in column C (for example using the formula =C5+B6) I wish to be able to cut rows, re-arrange rows and add new rows without affecting the formula. I have tried using F4 without success. Can anybody help please. One way: C1: =SUM(B$1:B1) and copy down as far as necessary. Obviously when inserting rows, you'll have to copy the formula to the new rows. In article <084d01c38786$9498b8b0$a101280a@phx.gbl>, "John Lanning" <lanningjohn@yahoo.com> wrote: &...

loading a count of another entity into a field on the primary entity
Hi I have a custom entity associated with Opportunities called Required Conditions. From the Opportunity enity I need to be able to check the count of the Required Conditions in order to disallow/allow certain actions. The simplest way of doing this (from what I can see) would be to populate a field on Opportunity with the count of the Required Conditions when the Opporutnity is loaded, however I have no idea how to do this. Can anyone out there assist? TIA Saira You may want to consider a callout (3.0)/plug-in (4.0) instead. Whenever one of your custom entities is created, updated...

Can't use key and keyref with an attribute in a group
Hi, Why can't I create a key and keyref with an attribute declared in an attribute group? Code below describes what I'm trying to accomplish. <!-- An attribute group --> <xs:attributeGroup name="AttGMain"> <xs:attribute name="Name" type="xs:string" /> <xs:attribute name="Type" type="xs:string" /> </xs:attributeGroup> <!-- CT using group above --> <xs:complexType name="ctView"> <xs:all> <xs:element name="Control" type="ctControl" /> <xs:eleme...

Setting table boundaries
Hi, I am trying to create a table in Excel that has 7 columns. one column is just a sequential number, the next 2 columns are values (one volts, the other current), and then finally 4 columns. I would like to divide the table into 4 rows section and identify this by different colors. the way i would like to divide this is by using voltage ranges, so if the voltage is between 1-10v then background color will be red, and the first of the last 4 columns is set to yes, if the volts is between 10-20 then the second valus is set yes and a differnt color is spplied to the rows? I would apprecia...

Can you set order in Pivot Table Drop Down box?
Hi, I made a pivot table for my group to use in a product mapping tool. The first column has the precursor products while the other column tell the replacement product. This question only involves th precursor products column. The problem is that the drop down box places the precursor product i alphabetical order while I need it to be in another order; basicall the order that they are used to seeing now (major products first). Ideal: Major Product 1 Major Product 2 Major Product 3 Auxilary Product 1 Auxilary Product 2 Auxilary Product 3 (list much longer, short list for illustrative purpo...

Reading text strings from a listbox in a different process
Does anyone have any ideas how to extract text strings from a listbox in different process? I've tried the following code, but had no success: HWND hWnd = ::FindWindow(NULL, m_window_caption); HWND hCtrl = ::FindWindowEx(hWnd, NULL, NULL, (LPCTSTR) m_controlname); long cId = ::GetWindowLong(hCtrl, GWL_ID); char buffer[2048]; int y = ::SendDlgItemMessage(hWnd, cId, LB_GETCOUNT, 0, 0); ::SendDlgItemMessage(hWnd, cId, LB_GETTEXT, y -1, (LPARAM) buffer); First, are you sure you have the right handle? You seem to be going through a fairly convoluted set of calls to solve a simple probl...

License Key Problems
I needed to unplug everything that was connected to the computer including the USB license key. After moving the computer to a different location and pluging back the USB license key, the POS tells me that the registration was not found. That was ok for a few days but now the POS has turned red and says its for Evaluation only. I'm afraid that the pos will stop working and prevent me from cashing people out on my lone register. I've tried pluging the key back in, re-starting the computer and nothing seems to work. Does anyone have any suggestions? try putting it to ano...

New Related Tables Records
Concerning my forms, I have buttons that will open a second form with information related to the record on the first form. For example, on a contact record, one might push the "Letters" button and see the letters sent to the contact in the past. I have navigational buttons on the form as well. However, when the 'New Record" button is pushed, it is necesary to select the contact again. How can I program the new record button to create a new record with the contact already filled out? The contact field in the related table is actually the id, but displays the company name ins...

Calculatting Time difference
I have a form where I am entering all issues. On this form I placed subform where I am displaying issues that are still open and not resolved. I want to display time difference between current time and the last update. Here is the code I am using: Private Sub Form_Timer() Dim sngElapsedTime As Date Dim Last_Update As Date 'determine the amount of time that has elapse between last update ' and now. sngElapsedTime = Now() - [Last Update] 'Update the timer txtTimeDiff = Format(sngElapsedTime, "hh:mm:ss") End Sub Timer interval is set to ...

Move a tab to a different file
Hi I got many following messages while trying to move a tab to a different file and I was not able to move the tab.. "A formula or sheet you want to move or copy contains the name "xxx", which already exists on the destination worksheet. Do you want to use this version of the name?" I do not have the specified name on the worksheet.. Please help!! Hi have you checke 'Insert - Name - Define' if the same name exists in both workbooks? -- Regards Frank Kabel Frankfurt, Germany "Jason" <anonymous@discussions.microsoft.com> schrieb im Newsbeitra...

Data Table only
How can i get data to appear (in a data sheet if need be) but not the chart A data table is part of a chart, so you can't have a data table without a chart. Or maybe I misundersand your question. John Walkenbach For Excel tips, macros, & downloads... http://j-walk.com/ss "JD" <anonymous@discussions.microsoft.com> wrote in message news:056f01c3a31d$ef23dd70$a101280a@phx.gbl... > How can i get data to appear (in a data sheet if need be) > but not the chart If you already have the data in some cell range, isn't that range a data table in its own right? -...

Contacts should have both a primary contact and primary account
My customer would like to have both a primary contact and primary account like the account record. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=dcb8b04e-171f-4d5a-8b96-f...

Pivot table and percentage
I have an excel spreadsheet with the following information: SCHOOL, PERSON, SUBJ, COURSE_TYPE, COURSE, SECTION, TERM, OUTSIDE_RANGE AA, John Doe, Math, 1U, 101, 01, 200508, 0 AA, John Doe, Math, 1U, 102, 01, 200508, 1 AA, John Doe, Math, 1G, 601, 70, 200508, 0 AA, John Doe, Math, 1U, 101, 01, 200601, 0 AA, John Doe, Math, 1U, 101, 02, 200601, 1 AA, John Doe, Math, 1U, 101, 03, 200601, 1 AA, John Doe, Math, 1U, 101, 01, 200608, 0 AA, John Doe, Math, 1U, 102, 01, 200608, 1 AA, John Doe, Math, 1U, 103, 01, 200608, 0 I want to be able to have in a pivot table the following: Page TERM Rows SCHO...

One File, Two Copies of Money, Different Sums, WHY?
Anyone seen anything like this? My sum of my stock portfolio is WAY off, by a factor of 3. But just on one computer. On my wife's computer, SAME file, same version of money, stock porfolio totals correctly. Ideas? Besides a slap upside Bill Gates head? (He's in vegas showin' friggin' watches that download the temperature off the internet and his finance software can't add... Grrrr.) One possibility is different patches. This has been reported once before, IIRC. You might consider the drill in http://www.bollar.org/msmoney/#Q104. "Seth Jayson" <sethcjayson@...