Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie help

Status
Not open for further replies.

liloandstitch

Technical User
Mar 29, 2003
7
AU
Couple of questions. I have a table in which I have types doubles and integers. I need to make sure the length of these fields are certain lengths, eg the integer length is 4 and double length is 7. There is no field in which to specifify this, so do I specify it via an input mask? I also have a table in which I have two foreign keys which link to two primary keys in the same table. I drag the first foreign key to it's respective primary key and it's fine, however when I go to drag the next foreign key, it says I can't have more then one relationship. Any ideas?
Thanks for any help
 
Hi

Use the Validation property in design view of the table to control the 4 digit and 7 digit thing, eg if you menn must be 4 digits eg 1000 - 9999 then use >=1000 and <=9999 in the validation property, similarly the seven digit number eg >=1000000 and <= 9999999

Your relationship problem, you cannot have two primary keys in one table, do you mean you have a composite primary key (ie a primary key composed of two columns)?, if yes, when you drag the first column in the relationship set up, when the dialog box asking if you want referentila integrity etc pops up, edit the list of columns in the box to include the second column of the compound primary key Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
I've added the validation rule so thankyou!!! Still not sure about the relationship problem. I have a stock table which is made up of two primary keys, DistrNo and SerialNO. The Lineitem has these two fields in it (DistrNo and SerialNo) and it specifies that the DistrNo in LineItem is the foreign key for the DistrNo in the stock table. Same goes for Serial No. So when I drag DistrNo from LineItem table to the Stock table it's fine, but when I drag the SerialNo from LineItem table to stock table, it says I can't have two primary keys. I'm obviously still doing something wrong! Please help!
Thanks
 
Hi

I can only repeat what I said in first post, this is how you do it:

Your relationship problem, you cannot have two primary keys in one table, do you mean you have a composite primary key (ie a primary key composed of two columns)?, if yes, when you drag the first column in the relationship set up, when the dialog box asking if you want referential integrity etc pops up, edit the list of columns in the box to include the second column of the compound primary key
Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top