Forums
This topic is locked
Invalid use of Null: 'CStr'
Posted 05 Apr 2007 14:23:56
1
has voted
05 Apr 2007 14:23:56 Nicola Young posted:
Help, Using dreamwever 8 and asp to build forms with drop down menu which may contain data and may not, this depends on what a use selects prior to getting to the page.
I know the reason this error is coming up is because there is not data in the database but not sure how to get round this problem.
code below - hope someone can help!
<td width="110" nowrap bordercolor="#00934F"><select name="R3_Comp" class="newdesign" id="R3_Comp" title="<%= AuditEnvironment.Fields.Item("R3_Comp"

<%If (Not isNull("R3_Comp"




<option value="<%=(AuditEnvironment.Fields.Item("R3_Comp"







<option value="YES" <%If (Not isNull("R3_Comp"




<option value="NO" <%If (Not isNull("R3_Comp"




<option value="Pending" <%If (Not isNull("R3_Comp"




Replies
Replied 25 Apr 2007 15:50:56
25 Apr 2007 15:50:56 Dimitris Kouris replied:
I think you should try to use the "if, then, else" conditions to validate if the existence of the field value.
For instance where you have,
.... "R3_Comp" title="<%= AuditEnvironment.Fields.Item("R3_Comp"

try:
.... "R3_Comp" title="
<%
if AuditEnvironment.Fields.Item("R3_Comp"

<%= AuditEnvironment.Fields.Item("R3_Comp"

<%Else%>
<% = NO DATA FOUND (OR SOMETHING ELSE) %>
<% End if %>" ...
Dim