Parent-Child Form (1 Viewer)

Martyh

Registered User.
Local time
Today, 14:49
Joined
May 2, 2000
Messages
196
Hi!
How can you tell (programmatically) if there is value in a Child ?
eg Me!sfrmAttachmentDetails.Form!ParticipantID

I currently have a form and a sub form in a typical 1 to many relationship.

I would like to know how I could determine if there is data entered into the many side of the relationship.
This is for a deletion control on the main form:
1) On delete of the many, if there is none, do nothing.

2) If there is, then delete.

I have no. 2 figured out but I just can't get my head around No. 1

Please HELP!!

Have already tried:
isNull(Me!sfrmAttachmentDetails.Form!ParticipantID)
isEmpty(Me!sfrmAttachmentDetails.Form!ParticipantID) &
isError(Me!sfrmAttachmentDetails.Form!ParticipantID)
None of these appear to work!
 
Last edited:

HiTechCoach

Well-known member
Local time
Today, 13:49
Joined
Mar 6, 2006
Messages
4,357
I don't worry about first checking to see if any records exist before running a delete query. I just try to delete any related records by running the query.

I have not had an issue running a delete query when there are no records.

Are you getting an error?

If you really want to check then try:

Code:
If Me.sfrmAttachmentDetails.Form.RecordCount > 0 then 
' run the delete code
End If
 
Last edited:

thunder

Just Want To Know More
Local time
Today, 11:49
Joined
Feb 28, 2009
Messages
26
Hitech Is absolutley right
do not worry if there is data or not you are going to delete it after all
 

Martyh

Registered User.
Local time
Today, 14:49
Joined
May 2, 2000
Messages
196
Hitech coach and thunder!

Thanks for your quick reply!

I guess I need a kick in the pants! Of course your solution is right! I was getting an error message that there was no record ... but duh!!

Thanks
 

Users who are viewing this thread

Top Bottom