UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Max Record Is 100, Any Version    
 
   
access2009eg
post Feb 13 2018, 07:12 AM
Post#1



Posts: 998
Joined: 19-February 08



friends;
have good day
how can i create validation rule for table that prevent user from enter more than 100 record(row) in the table

table field example

ID(autoNumber) MName
1 ssss
2 bad


i'm try but notwork
count ([ID])<=100

how can i do that

using validation rule
Or Constraints



Go to the top of the page
 
Larry Larsen
post Feb 13 2018, 07:34 AM
Post#2


UA Editor + Utterly Certified
Posts: 24,239
Joined: 26-August 02
From: Melton Mowbray,Leicestershire (U.K)


Hi
Are these records entered through a form as "single" records or in a mass input..??

Using a form to control the volume of input can be done, you can also inhibit the input based on a # of records in a table..

Interesting in knowing why your restricting a total record count of a 100 in a table..??
thumbup.gif
Go to the top of the page
 
access2009eg
post Feb 13 2018, 07:50 AM
Post#3



Posts: 998
Joined: 19-February 08



Mass Input
copy and paste
Go to the top of the page
 
Larry Larsen
post Feb 13 2018, 08:08 AM
Post#4


UA Editor + Utterly Certified
Posts: 24,239
Joined: 26-August 02
From: Melton Mowbray,Leicestershire (U.K)


Hi
Thanks.. but I feel we need a little bit more details about your reply on what is "Mass input & C&P" process..!!

Trying to work out what event would/could be triggered to then evaluate the record #..

I'm thinking alone the line of "RecordsetClone" and can that be used to count the records that are currently active before committing the records to the table..
compute.gif iconfused.gif
Go to the top of the page
 
BruceM
post Feb 13 2018, 08:08 AM
Post#5


UtterAccess VIP
Posts: 7,752
Joined: 24-May 10
From: Downeast Maine


Please describe exactly what you mean by "Copy and Paste". Are you copying and pasting one record at a time, or are you using SQL to transfer a batch of records at once.

Edit: Larry got there first. I will leave this to Larry since he responded first, and has in-depth knowledge of Access that I cannot match. I just wanted to help out by asking that more details be provided.
Go to the top of the page
 
access2009eg
post Feb 13 2018, 09:36 AM
Post#6



Posts: 998
Joined: 19-February 08



Larry Larsen
thank you

just i need to prevent user from copy data(access or excel) and paste it in my database the row number my be different than 100 maybe 150 or 300

i need just count record

as this example
CODE
CurrentProject.Connection.Execute " ALTER TABLE Table1 ADD CONSTRAINT kkl CHECK (Count([id])<20)"


or something like that

i will not use form
Go to the top of the page
 
access2009eg
post Feb 13 2018, 10:36 AM
Post#7



Posts: 998
Joined: 19-February 08



i find the answer
CODE
CurrentProject.Connection.Execute " ALTER TABLE Table1 ADD CONSTRAINT kkl CHECK ((SELECT COUNT(*) FROM Table1)<20)"
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    10th December 2018 - 04:52 PM