Sub Forms

MaleNurse325

Registered User.
Local time
Yesterday, 21:31
Joined
Jan 11, 2016
Messages
72
Hi,
I have a form called frmRegister on which is a sub form sfrmPriority They are linked Master = MaterID (an AutoNumber) and PriorID (again an AutoNumber) All works well until I try to add a record to the system and then the sub form sfrmPriorty is blank even when I start to add details to the frmRegister.
How do I link them from as soon as I start to populate the master form please?
:banghead::banghead::banghead::banghead::banghead::banghead::banghead:
 
Hi

Do you have MasterID as a Foreign Key in tblPriority??
 
it is the Primary Key. I will show my ignorance now and ask.. What is a foreign key?
 
Hi

Table structure should be along these lines

tblRegister
- RegisterID - Autonumber Primary Key (You are using MasterID.)
-(Other fields to describe the Register

tblPriority
-PriorityID - Autonumber - Primary Key)
-RegisterID - Number - Foreign Key (Linked to RegisterID from tblRegister)
-(Other fields to deal with Priorities)

So in tblRegister when you create your First Record you will have a Unique ID - 1

Then when you add data to your subform the Primary Key and the Foreign Keys will Populate automatically as you enter data in each of the Other Controls.
 

Users who are viewing this thread

Back
Top Bottom