This will probably seem like another duh question. I just don't know how to write code.
I have a UIL competition registration that has a maximum number of participants per school per grade per event.
I have a qryPartNumbersRe that has current totals and maximums, along with school, grade and event.
It doesn't matter the values I have in the table so far, it continues to give me the message - This registration was not added. The maximum number of participants has already been reached.
Could you please let me know what I'm doing wrong if it's easy to tell?
Thanks for all your help.
This is the event code so far on my registration_add.asp page.
Function BeforeAdd(dict)
' Parameters:
' dict - Scripting.Dictionary object.
' Each field on the Add form represented as 'Field name'-'Field value' pair
'** Check if specific record exists ****
strSQLExists = "select * from QryPartNumbersRe where event ='" & dict("event") & "' and school='" & dict("school") & "' and grade='" & dict("grade") & "'"
set rsExists = CreateObject("ADODB.Recordset")
rsExists.Open strSQLExists, dbConnection
Response.write strSQLExists
if TotalParts > maximum then
BeforeAdd = True
Response.write "Registration added."
else
BeforeAdd = False
Response.write "This registration was not added. The maximum number of participants has already been reached."
end if
rsExists.Close : set rsExists = Nothing
End Function