Results 1 to 5 of 5

Thread: subform (2k)

  1. #1
    New Lounger
    Join Date
    Mar 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    subform (2k)

    I did invoise form 2 forms 1 is main & 2 is sub .
    I want to make the subform not allow more that 10 records in invoise .
    Ashraf

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: subform (2k)

    The only thing I can suggest is that you have a lineno field in the subform table, with the primary key (or at least a unique key) of invoice# and lineno. Set a validation rule on the lineno field to be "between 1 and 10".
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: subform (2k)

    In the On Current event of your subform insert the following function

    <pre>Private Sub Form_Current()
    If Me.Recordset.RecordCount >= 10 Then
    Me.AllowAdditions = False
    Else
    Me.AllowAdditions = True
    End If
    End Sub
    </pre>

    Francois

  4. #4
    New Lounger
    Join Date
    Mar 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: subform (2k)

    Thank u Francois very much , it is work good
    Asharf

  5. #5
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    160
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: subform (2k)

    I TRY THIS CODE IT WORK ALREADY BUT THE SUBFORM NO AllowAdditions IN A NEW INVOISE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •