Results 1 to 3 of 3
  1. #1
    dgutsche is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    35

    Question Controlling the Number of Records in a Subform

    Hello again!



    I am trying to decide if this is a safe thing to do. I would like to lock the number of records in a sub form based upon the a field in a parent form. For instance, if the field box says 5 in the parent form I want exactly five records to be generated in the subform. I don't want the user to be able to add records without upping the field value from the main table. Is there a good way to do this - is it even a safe thing to do?

    Thanks!

  2. #2
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Don't understand the reasoning for this but yes it can be done. Example: Just add your criteria.

    If Form.RecordsetClone.RecordCount > 5 Then
    Cancel = True
    End If
    HTH

  3. #3
    dgutsche is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    35
    Okay that works, I should be able to tweak it by changing the 5 to reference the field in the parent form. I hope ha ha. I should be able to figure that out.

    Thanks again burrina!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. limit number of records in a subform
    By PJT in forum Forms
    Replies: 4
    Last Post: 04-13-2014, 11:29 AM
  2. Replies: 12
    Last Post: 08-26-2012, 02:09 PM
  3. Controlling subform resize
    By Deutz in forum Forms
    Replies: 2
    Last Post: 10-13-2011, 07:35 PM
  4. Replies: 6
    Last Post: 07-25-2011, 01:54 PM
  5. Controlling Subform from Main Form
    By SteveF in forum Forms
    Replies: 5
    Last Post: 07-01-2011, 05:32 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums