| | |
|
|
|
Limit Number of records in a Subform |
| message from Nick1966 on 26 May 2004 |
Hi
I have a Main Form that displays the number of products received on any
particular order. The details of which are then entered into a subform. Is
it possible to set the properties of the sub form to display only enough
spaces for the number of products received i.e. if three products received
then only three records can be entered onto the sub form. I am using Access
2000 on WIN2K Pro
Cheers Nick
|
| Arvin Meyer replied to Nick1966 on 26 May 2004 |
Try using the recordcount property of the subform's recordset in the
subform's OnCurrent event. Something like:
Dim rst As Recordset
Dim i As Integer
i = Me.ProductsReceived
Set rst = Me.recordsetclone
If rst.recordcount > i - 1 Then
Me.DefaultEditing = 4
Else
Me.DefaultEditing = 2
End If
|
|
Archived message: Limit Number of records in a Subform (MS Access Error Message)