How to refrence primary key and forgine key

tony007

Registered User.
Local time
Today, 11:04
Joined
Jun 30, 2005
Messages
53
Hi guys. could any one help refrence primary key and forgine key in access db using vba code and show it in message box.thanks
 
Primary and Foreign Keys are just regular fields in a table. You would reference them the same way you reference any field in a table. I expect there is more to your question that will now appear.
 
I think he's asking.. how can you tell if a field is a PK or a FK
 
modest said:
I think he's asking.. how can you tell if a field is a PK or a FK
THank u guys for u reply. I want to use vba to identify and print the pk and fk of tables in my db . I be happy if some one show me how.Thanks
 
Look in the VBA Help system for Index Collection (DAO). There are examples of code in there to print out almost anything you want.
 
Last edited:
Thanks for u reply. When i try to run it in module windows . I get the following error :

compile error
sub or function not defind
and it points to the following window
Code:
  ' Print report.
   FieldOutput "TableDef", fldTableDef

further more if i want run it for my current db what should i do?Thanks
 
Thanks again. could u tell me where to place this code ? should i add replace it with yoru first coder or add it ? Thanks
 

Users who are viewing this thread

Back
Top Bottom