UtterAccess.com
We have detected that you are using an unsupported web browser. We recommend you to upgrade your web browser to get the most from UtterAccess forums.
Why should and how can I upgrade?
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Limit number of entries in table/form?, Office 2007    
 
   
simonlang
post May 25 2010, 07:01 AM
Post #1

UtterAccess Enthusiast
Posts: 81



access 2007
aving left my database alone for some months, I've come back to it wanting to start to build a demo out of it and for the life of me can't figure out how to restrict my db to a specific number of contact entries (lets say 5) a user can input before a message will tell them, "this is a demo da de da de da". I've yet to decide on any other demo attributes of which I've noticed some excellent posts here to get me going, just need a small push in the right direction with regards to limiting the amount of contact records
Has always, many thanks in advance
Simon
Go to the top of the page
 
+
Scott McDaniel
post May 25 2010, 07:06 AM
Post #2

UtterAccess VIP
Posts: 569
From: North Augusta, SC



Here's a link that might be helpful: http://www.granite.ab.ca/access/demo.htm. Tony goes into detail about the methods he uses for his demo systems, and this includes a method to limit the number of records.
You might also consider a 3rd party product. I've been playing with this one and it seems pretty neat: http://www.ssware.com/cryptolicensing/cryp...censing_ocx.htm
Go to the top of the page
 
+
Alan_G
post May 25 2010, 07:08 AM
Post #3

Utterly Yorkshire and Forum/Wiki Editor
Posts: 16,230
From: Devon UK



Hi
You could use a simple DCount() at point of data entry or set a constraint on the table itself to limit the number of records.
Simplest way would be to use DCount() in whatever event of your data entry form suits your needs, along the lines of
CODE
If DCount("*", "YourTableName") >= 5 Then
  Msgbox "Maximum number of records allowed has been reached in demo mode",vbOKOnly + vbExclamation,"Demo mode"
  'code to stop entry of new records
End If
Go to the top of the page
 
+
simonlang
post May 25 2010, 09:38 AM
Post #4

UtterAccess Enthusiast
Posts: 81



Hi both....Alan that's just the fella, thank you so much...Scott, thanks for the link, some interesting reading there, although I don't understand some of it, I think it's the direction I should eventually be going
Thank you both again
Go to the top of the page
 
+
Alan_G
post May 25 2010, 10:32 AM
Post #5

Utterly Yorkshire and Forum/Wiki Editor
Posts: 16,230
From: Devon UK



No problem, Scott and I are happy to help ":thumbup:" border="0" alt="thumbup.gif" />
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Search  ·  Go to Top  ·  Lo-Fi Version Time is now: 31st October 2014 - 02:56 PM