This topic is locked
[SOLVED]

 check to see if specific record already exists

3/21/2014 12:18:02 PM
ASPRunnerPro General questions
J
jmccullough author

I have a registration table (Coordinator Registrations) with the following fields: Fname Lname District. I need to allow only one registration per District, so I need to check the table to see if anyone has already registered with that District. I am using AspRunner Pro 7.2

Here is the code I am using in the "Before Record Added" event page and it isn't working even though I have a District with the same name already in the table. No message is produced. District is a text field. Can anyone please tell me what I'm doing wrong. Thank you for any help.
dim rsDistrict

set dal_table=dal.Table("Coordinator Registration")

set rsDistrict = dal_table.Query("District='" & values("District") & "'","")

if not rsDistrict.eof then
Response.Write "This school district is already registered."

beforeadd = false

else

BeforeAdd = true

end if

Sergey Kornilov admin 3/23/2014

I would make sure first that you specify return value properly. "beforeadd = false" is most like incorrect while "BeforeAdd = false" is better. Everything is case sensitive unless specified otherwise.

J
jmccullough author 3/23/2014

Thank you for the reply. I have tried your suggestion (making case sensitive) but it still does nothing. No Message and it adds new registration to table even though there is already a registration for that school district.
Anything else I can try ? Thank you.

Sergey Kornilov admin 3/23/2014

Feel free to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

J
jmccullough author 3/23/2014



Feel free to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.


Thank you. I will open a ticket and upload to Demo Account tomorrow (monday).

G
gonzalosb 4/18/2014

hi all,

witch was the solution for this post?

i'm trying to do something similar
thank you.