Syntax Error in IF statement

N

Nate

I am trying to use the following IF statement, and whenever I use a
single or double quote, I receive a syntax error. When using no
quotes, the syntax is accepted, but the statement does not perform
properly.

***The problem line***
<% if violation_type=''Tardy'' THEN %>
***rest of the statement***
TARDY VIOLATIONS
<% if rs2.Fields(0) = 0 THEN %>
This is the first unexcused Tardy violation for this employee. A
coaching is required. Click <A HREF=blah>HERE</A> to issue the
coaching.
<% ELSE %>
This employee has <%response.write(rs2.Fields(0))%> previous
violations.
<% END IF %>
<% ELSE %>
The <%response.write(violation_type)%> violation has been recorded.
<% END IF %>

Variables defined:
violation_type = request.form("violation_type")

Any ideas?
 
A

Anthony Jones

Nate said:
I am trying to use the following IF statement, and whenever I use a
single or double quote, I receive a syntax error. When using no
quotes, the syntax is accepted, but the statement does not perform
properly.

***The problem line***
<% if violation_type=''Tardy'' THEN %>

Are you saying the above line as it is generates a syntax error??
 
N

Nate

For some reason, it was. I loaded the code up into Source Edit and
made some changes to other parts of the code, and suddenly it worked.
I appreciate you taking the time to reply - must have been a fluke :-\
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top