dbTalk Databases Forums  

forbit deleting a record if it has related records in an other table

comp.databases.filemaker comp.databases.filemaker


Discuss forbit deleting a record if it has related records in an other table in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Hatzigiannakis Nikos
 
Posts: n/a

Default forbit deleting a record if it has related records in an other table - 02-19-2007 , 02:51 PM






How can I prevent the deletion of a record if it has related records in
FM8.5 pro?

In FM6.0 I used the isvalid(othertable::field) function to determin the
existance of related records. This doesnt seam to work in 8.5. Any
sugestions?



Reply With Quote
  #2  
Old   
Helpful Harry
 
Posts: n/a

Default Re: forbit deleting a record if it has related records in an other table - 02-19-2007 , 05:35 PM






In article <erd2k0$ljl$1 (AT) mouse (DOT) otenet.gr>, "Hatzigiannakis Nikos"
<ypai (AT) aigaio (DOT) gr> wrote:

Quote:
How can I prevent the deletion of a record if it has related records in
FM8.5 pro?

In FM6.0 I used the isvalid(othertable::field) function to determin the
existance of related records. This doesnt seam to work in 8.5. Any
sugestions?
You can Count the related records instead.
ie.
If [Count(Relationship::KeyField) = 0]
Delete Record []
Else
Message ["Can not delete - has related records"]
End If

where KeyField is the same field used to make the Relationship link
work. Using this field means it must ALWAYS have data in it and
therefore will be counted, whereas using another related field that may
be empty gives an inaccurate count.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.