Subform with empty child data

omontesg

Registered User.
Local time
Today, 13:36
Joined
Feb 8, 2008
Messages
10
Good afternoon ;

I have 2 tables:
FatherTable and ChildTable. related by a field one to many.

Records in FatherTable may or may not have child records in ChildTable. (That is possible and logical isn' it?)

I Have the Father data shown in a Form "FatherForm".
I Have the Child Data shown in a Pop Up Form "ChildForm", that appears when the FatherCode control on the FatherForm is clicked

When the FatherTable HAS Child Records in ChildTAble every thing works fine.

BUT when the FatherTable HAS NOT Child records in ChildTable I get the Access Message "Index or primary key cannot contain a null value" and the tables lose sinchronization: trying to select another FatherCode is no possible and the message keeps appearing.

Where is the problem and how can it be solved ?

Thanks for any help from any body
omontesg
 
How about checking for child records with DCount() before opening the PopUp?
 
How about checking for child records with DCount() before opening the PopUp?

There is not option. I must show ALWAYS the PopUp ChildForm because:
1-It makes sure the user to know there are or there are no Child Records
2-I use this ChildForm for the user to Add/Edit ChildRecords.

It works his duty But I hate ( and surely my users will too ) the famous Access Message.

Thanks for your Interest
 

Users who are viewing this thread

Back
Top Bottom