UtterAccess.com
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

Having 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

as 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,058
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,058
From: Devon UK



No problem, Scott and I are happy to help (IMG:style_emoticons/default/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: 17th April 2014 - 04:34 AM