🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#195
From: Scott Mordecai
Date: Mon, 04 May 1998 00:00
18 lines
1266 bytes
>Assuming the foreign key in the subforms recordset is called "FK" then:
>
>Sub Form_BeforeInsert(Cancel As Integer)
>  If DCount("*","ThisTable","FK = " & Me!FK)>=3 Then
>    Cancel = True
>    Msgbox "Rassssssssssssp!"
>  End If
>End Sub

Thanks for that, but I'm afraid I have no idea where I should enter it.
One of the before/after update field options perhaps?

Cheers,
-- 
 \|||/  Scott Mordecai
< o,o > mailto:scott@musicman.demon.co.uk
  \_/
Technical Details
Message-ID: <WG9DUHAFFfT1Ewnt@musicman.demon.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <cUehgLAJMNT1Ewmx@musicman.demon.co.uk> <35640a0b.6616746@news.easynet.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: Scott Mordecai <Scott@musicman.demon.co.uk>
Subject: Re: How can I limit the number of records in a table? (MS Access)
Date: 1998/05/04
Message-ID: <WG9DUHAFFfT1Ewnt@musicman.demon.co.uk>
X-Deja-AN: 350150391
X-NNTP-Posting-Host: musicman.demon.co.uk:158.152.20.171
References: <cUehgLAJMNT1Ewmx@musicman.demon.co.uk> <35640a0b.6616746@news.easynet.co.uk>
X-Complaints-To: abuse@demon.net
X-Trace: news.demon.co.uk 894300530 nnrp-07:23543 NO-IDENT musicman.demon.co.uk:158.152.20.171
Organization: Anywhere
MIME-Version: 1.0
Newsgroups: comp.databases.ms-access,demon.tech.pc