A Allen Browne Sep 8, 2007 #2 Use the BeforeInsert event procedure of your subform. Cancel the event if there are already too many records. If this is important, you might want to DCount() the relevant records in the subform's table rather than just read Me.RecordsetClone.RecordCount.
Use the BeforeInsert event procedure of your subform. Cancel the event if there are already too many records. If this is important, you might want to DCount() the relevant records in the subform's table rather than just read Me.RecordsetClone.RecordCount.
A Arvin Meyer [MVP] Sep 8, 2007 #3 Pookey said: How do you limit the number of records you have in a subform? Click to expand... Try using the recordcount property of the subform's recordset in the subform's Current event. For 5 records you would do something like: Dim rst As DAO.Recordset Set rst = Me.RecordsetClone If rst.RecordCount >= 5 Then Me.DefaultEditing = 4 Else Me.DefaultEditing = 2 End If
Pookey said: How do you limit the number of records you have in a subform? Click to expand... Try using the recordcount property of the subform's recordset in the subform's Current event. For 5 records you would do something like: Dim rst As DAO.Recordset Set rst = Me.RecordsetClone If rst.RecordCount >= 5 Then Me.DefaultEditing = 4 Else Me.DefaultEditing = 2 End If