Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting Records on a subform 1

Status
Not open for further replies.

techkenny1

Technical User
Jan 23, 2009
182
AU
Hi all,

I am using a subform which is a continous form. Due to the fact that I have to use an A4 landscape report page format I need to limit the no of records to 12.

If the user adds more records of course they will not appear on the report.

How can I stop the user from entering more data after they have entered 12 records.

Many thanks,

KP
 
how about page2?

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work
 
The RecordSet.RecordCount will tell you how many records you have. After they get to 12 then turn off AllowAdditions in the Current event.

(RG for short) aka Allan Bunch MS Access MVP acXP ac07 winXP Pro
Please respond to this forum so all may benefit
 
Hi Guys,
Thanks for your ideas.
Firstly I don't undertand what is meant by page 2 and I really require some code to automatically stop more records being entered.
To turn off the allow editions I am not sure how that could be done without going to the properties and doing it there.
ANy more ideas would be appreciated.
KP
 
Put this in the Current event of your SubForm:
Code:
Private Sub Form_Current()

   If Me.Recordset.RecordCount > 12 Then
      Me.AllowAdditions = False
   Else
      Me.AllowAdditions = True
   End If

End Sub


(RG for short) aka Allan Bunch MS Access MVP acXP ac07 winXP Pro
Please respond to this forum so all may benefit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top