Normal Topic Limit amount of records in a subform (Read 429 times)
debmckee
Full Member
***
Offline



Posts: 123
Joined: Oct 5th, 2011
Limit amount of records in a subform
Mar 15th, 2012 at 10:46pm
Print Post Print Post  
Is there a way to limit the number of subrecords that can be entered to a parent form?
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: Limit amount of records in a subform
Reply #1 - Mar 15th, 2012 at 11:00pm
Print Post Print Post  
In Sesame, ANYTHING is possible. Try something like this to prevent adding more than 100 records...

Code
Select All
If @formresultsettotal("MySubrecordsForm") > 100 then @msgbox("Sorry","You cannot enter any more subrecords.","") else
{
//code to add new subrecords
}
 



If you are trying to limit the number of PARENT Records, then check out the NotifyForm() examples in the programming manual. Something like this should work:

Code
Select All
if @formresultsettotal("MyParentForm") is >100 then NotifyForm(2) 



Hope that helps!
  
Back to top
IP Logged
 
debmckee
Full Member
***
Offline



Posts: 123
Joined: Oct 5th, 2011
Re: Limit amount of records in a subform
Reply #2 - Mar 15th, 2012 at 11:24pm
Print Post Print Post  
Thank you!  Also..........any  question in the  forum also seems to be possible...

I love all the help I get.  Sesame has better customer service than any other program I have worked with.
  
Back to top
 
IP Logged