🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.databases.ms-access
Article #192

Re: How can I limit the number of records in a table? (MS Access)

#192
From: Dev Ashish
Date: Sun, 03 May 1998 00:00
43 lines
1810 bytes
Hi Scott,

You hanve't mentioned the Access version.  But something like this should
work under 97.

Private Sub Form_Current()
    If Me.NewRecord Then
        With Me.RecordsetClone
            .MoveLast:  .MoveFirst
            If .RecordCount >= 5 Then
                MsgBox "Can't add more than 5 records!"
                .MoveLast
                Me.Bookmark = .Bookmark
            End If
        End With
    End If
End Sub

HTH
--
Dev Ashish (Just my $.001)
---------------
The Access Web ( http://home.att.net/~dashish )
---------------

Scott Mordecai wrote in message ...
>Hi, I hope I can make some sense here...
>
>I have a form which has basic record details (person's name, telephone
>number, etc.). On this form is a datasheet sub-form where I can list a
>number of items. I would like to limit the number of entries on this
>datasheet.
>
>e.g. the datasheet has two fields, "Name" (linked to the main record
>table) and "Item". I would like each "Name" to be allowed only a maximum
>number of items.
>
>Any help, if the above makes any sense, is appreciated!
>--
> \|||/  Scott Mordecai
>< o,o > mailto:scott@musicman.demon.co.uk
>  \_/
Technical Details
Message-ID: <6iitlc$c3p@bgtnsc03.worldnet.att.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <cUehgLAJMNT1Ewmx@musicman.demon.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1036bc,d87e857d2b30eade
X-Google-Attributes: gid1036bc,public
X-Google-Thread: ff0ac,d87e857d2b30eade
X-Google-Attributes: gidff0ac,public
From: "Dev Ashish" <dash10@hotmail.com>
Subject: Re: How can I limit the number of records in a table? (MS Access)
Date: 1998/05/03
Message-ID: <6iitlc$c3p@bgtnsc03.worldnet.att.net>
X-Deja-AN: 349936044
References: <cUehgLAJMNT1Ewmx@musicman.demon.co.uk>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: AT&T WorldNet Services
Newsgroups: comp.databases.ms-access,demon.tech.pc