![]() |
Sergey Kornilov admin 3/2/2007 |
Use BeforeAdd event to calculate how many records this user has already and if limit is reached display the error message and prohibit record addition. |
T
|
text author 3/6/2007 |
Use BeforeAdd event to calculate how many records this user has already and if limit is reached display the error message and prohibit record addition. More detailed answer is not possible without knowing details of your project and database structure.
|
J
|
Jane 3/6/2007 |
Richard, Sub AddOnLoad() str = "select count(*) from " & strTableName & " where member_ID='" & Session("UserID") & "'" Set rsTemp = server.CreateObject("ADODB.Recordset") rsTemp.open str, dbConnection if rsTemp(0)>10 then %><script> alert("you can't add more then 10 records"); </script><% end if rsTemp.Close : set rsTemp = Nothing End Sub |
T
|
text author 3/8/2007 |
Hi Jane |
T
|
text author 3/8/2007 |
Actually - sorry I shouldn't have replaced StrTableName I believe. |
![]() |
Sergey Kornilov admin 3/8/2007 |
Here is the slightly better version that actually prevents new record from being added. Function BeforeAdd(dict) |
T
|
text author 3/9/2007 |
Here is the slightly better version that actually prevents new record from being added. You need to use BeforeAdd event for this purpose: Function BeforeAdd(dict)
|
T
|
text author 3/12/2007 |
Here is the slightly better version that actually prevents new record from being added. You need to use BeforeAdd event for this purpose: Function BeforeAdd(dict)
|
J
|
Jane 3/13/2007 |
This code works fine on my test box. |
T
|
text author 3/13/2007 |
This code works fine on my test box. You can please publish your project on Demo Account and post a URL to your pages here or send it to support@xlinesoft.com. I'll find what's wrong with your project inspecting it at Demo account site.
|