473,396 Members | 2,057 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do I set a limit to the amount of records can be entered in an access table?

I have made an access database and need to be able to limit the amount of entries for specific attributes.

This is the contents of the table:
Student Subject Enrolment (tblStudentSubEnrol)
• Student Code (tblStudentDetails) (Relationship)
• Subject Code (tblSubjects) (Relationship)
• Date of Enrolment

I need to be able to limit so there can only be a minimum of 3 and a max of 4 repeated student codes within the tblStudentSubEnrol table.

I also need to be able to have a limit of 25 repeated subject codes in the tblStudentSubEnrol table.

Anyone have any idea how this can be done?
Mar 4 '19 #1

✓ answered by twinnyfo

Aidan24969,

Welcome to Bytes!

Your main challenge will be with the “minimum” requirement—which is impossible. How do you enter the first two while still meeting that first, minimum requirement. So, obviously, this check is something that you must do after the fact, after all enrollments are complete.

However, SagarJaybhay is on the right track. Every time you plan to enter data, you examine the validity of the data. If it meets your required criteria, add the record to the Table (I would recommend using an unbound form, so that you don’t accidentally add records that violate your rules).

One correction, though. Once the record is added, there is no need to “increment the count”, as your validation rules prior to adding the record do the counting. There is no need to save any counted values—this is a waste of DB resources.

Hope this hepps!

2 1293
First take count from your table if it satisfy your condition then enter data into table if not then simply reject the entry. After make new entry simple increment value of count. I think it will solve.
Mar 5 '19 #2
twinnyfo
3,653 Expert Mod 2GB
Aidan24969,

Welcome to Bytes!

Your main challenge will be with the “minimum” requirement—which is impossible. How do you enter the first two while still meeting that first, minimum requirement. So, obviously, this check is something that you must do after the fact, after all enrollments are complete.

However, SagarJaybhay is on the right track. Every time you plan to enter data, you examine the validity of the data. If it meets your required criteria, add the record to the Table (I would recommend using an unbound form, so that you don’t accidentally add records that violate your rules).

One correction, though. Once the record is added, there is no need to “increment the count”, as your validation rules prior to adding the record do the counting. There is no need to save any counted values—this is a waste of DB resources.

Hope this hepps!
Mar 5 '19 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Doomster | last post by:
I have Office 2000. I am creating a database that will record stats from football, basketball, and hockey games. One table will contain info about a game. The game could be a football,...
3
by: neelesh kumar | last post by:
sir, i have a java applet j2sdk1.4.1_01 .i am using msaccess database . Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"). in my program i want to get records from access table in a new frame...
2
by: jerrydigital | last post by:
Hi, I created a form for users to register that goes to an Access table. Unfortunately, when the user submits the form and the "Account number" text box is left empty, I get an error that tells...
12
by: anand padia | last post by:
I have a master access table where we store all the employee information. I have various application developed in excel which imports and uses information in master. Now I want to develop a excel...
2
by: samvb | last post by:
Hi, I am using datareport of vb6 which is bound to a table in access thru dataenvironment. The problem is it shows all records but the last one. What could be the thing? Is there anyway to refresh...
4
by: jimmcg | last post by:
how can i limit the records seen in an access report based on a subtotal amount?
1
by: padhoo nair | last post by:
Is there a way to retrieve accidentally deleted records from a access table?
2
by: prasad joshi | last post by:
I am trying to figure out a way to export any new data entered into an Excel 2003 spreadsheet into an Access 2003 database from the Excel application. I've seen lots of code originating in the Access...
22
by: beginneraccess | last post by:
I am a beginner in Access as of last week, so pardon my inability to understand Access; currently I am on Access 2013. I am trying to add multiple records to a table. For example, I have multiple...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.