简体   繁体   中英

How can I restrict record creation in access based on a field value?

I have a small access database I use to let students sign up for my afterschool classes (electronics, programming etc), I can only accept 30 people in each session.

At the moment they create their record and receive a message to learn how many people have already signed up (which I time-stamp in case of dropouts, first come first served).

However what I would like to do is prevent the record being created unless there is a slot available.

I've added a field on the form which says how many places are left, how can I stop access creating a new record when this value is <= 0?

Thanks in advance everyone

在窗体的OnCurrent事件中,插入以下代码行:

Me.AllowAdditions = (Me!PlacesLeft.Value > 0)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM