Results 1 to 2 of 2
  1. #1
    Join Date
    May 2014
    Posts
    4

    Unanswered: IF statement error please help

    i i need to be able to show a button only if the person has records in the system otherwise it should say "No Venue Details"

    if i change Irecords to 1 then it works but i want it to look at database and if there are records then show button. how do i make it count records
    what am i doing wrong please

    Code:
    <%
    Dim iRecords
    iRecords = <%=iRecords%>
    IF iRecords <> "0" THEN
    %>
    	<table border="0" width="100%">
                      <form method="post" action="venuedetails.asp?ID=<%=strConID%>">
                      	<tr>
                        	<td align="center" class="PromoHeadingHomePage">
    						<font face="Calibri" size="2">Venue Details</font></td>
                        </tr>
                        <tr>
                          <td height="2" bgcolor="#333333"></td>
                        </tr>
                        <tr>
                        	<td align="center" class="tabletextsmall">
    						<font face="Calibri">
    						<input name="frmTestSub0" type="submit" value="Open" style="font-weight: 700; color:#000000" color:#000000" style="color:#000000; font-weight:700"" /></font></td>
                        </tr>
                      </form>
                      </table>
                    
    <%
    Else
       %>
    	<table border="0" width="100%">
         <tr><td align="center"><font face="Calibri" size="2">No Venue Details</font></td> </tr>
          </table>
             
    <%
       End If
    %>

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Your script is kind of reading like this:


    1 - declare a variable
    2 - check if the value of the variable is equal to...

    The problem here is that the variable is never actually assigned a value. Therefore we don't know if the value is equal to "1" or "2" or "cat" or "25/12/2014".
    The value is unknown.
    It is NULL.


    However, it also looks like you might have edited your code before posting. This makes it difficult to debug as we're not seeing the whole, true picture.
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •