Click to See Complete Forum and Search --> : problem with show region


dlacloche
09-18-2006, 11:58 AM
What I want to happen:
If a field in a record set is empty then show link on page.
If the field is not empty hide link.

Code I have that's not working the way I expect:

<%
Dim showRegion
showRegion=followUp.Fields.Item("followUpDate").Value
If showRegion<>"" Then %>
<tr>
<td><a href="addfollowup.asp">Add a follow up comment</a></td>
</tr>
<% End If %>

dlacloche
09-18-2006, 12:10 PM
Wait a minute. I was doing it wrong. What I really want is for the link to show if the recordset is empty.

So, I now have:
<% If followUp.EOF And followUp.BOF Then %>
<td><a href="addfollowup.asp">Add a follow up</a></td>
<% End If %>

But that's not working either. The link never shows.
I just had a thought. If the recordset is expecting a url variable, and it gets one that doesn't exist in the record set--like page.asp?visitID=27, but the recordset only has visitID up to 5, will the recordset go to its default value of visitID=1?
That's no good for me because then the recordset is not empty; it has one record in it.

Help!

Ubik
09-18-2006, 05:09 PM
Try:

<% If not followUp.EOF And not followUp.BOF Then %>
<td><a href="addfollowup.asp">Add a follow up</a></td>
<% End If %>

dlacloche
09-19-2006, 09:26 AM
I got this:

ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/millerscrr/milleroutputpage.asp, line 383

when I made the change.