Question : Primary Key- Foreign Key not showing

I have an access database. The primary key in one table A and  is set to autonumber
and links to a field in another table set to number (foreign key). Relationship is one to many. When I enter the data in table A shouldn't the value of the primary key show in the foreign key of table B ? If I do a query using table one and two, using the Primary key of table A link to the foreign key of table B nothing shows in the query. How does the primary key data-from table A- gets into the foreign key of the table B ? What I am doing wrong ? Maybe I missing a step. I have search the book Access2007  Inside/Out but dont seem to find the solution.
Thanks
DrA

Answer : Primary Key- Foreign Key not showing

>When creating a Mainform/subform, will the One to many table-in my example table A- be use as the mainform, and will table B-the one that has the foreign key from table A- be use as a subform ?

The design is yours, so you tell me.   That is certainly a very common approach.


Entering the values in table A as a Mainform, will that put the value in the foreign key of table B ?

No.  No.  No. How many B rows should it insert and what values should go in the other columns of table B?  

>How come when I run the query using table A and table B the query does not returned any results ?

Because you are using an inner join to table B which does not have any matching rows yet.  Use an outer join to table B or add rows to table B and your query will return results.
Random Solutions  
 
programming4us programming4us