DRW Question

C

CJ

Hi

I've used the FP2003 Database Results Wizard to produce property search
pages such as:

http://www.mymea.co.uk/search_2c.asp

What I would like to be able to do is show a default picture if the property
is sold. There is a field in the database which indicates when a property is
sold, but is there any way I can change the displayed picture depending on
the value of this database field?

All the "sold" properties would use the same picture.

Any advice appreciated.

CJ
 
T

Thomas A. Rowe

Why hide the photo, place the word SOLD above or below the photo?

<% If fp_rs("sold") = True then %>SOLD<% End If %>

where ever you want the word to be displayed.

To swap the photos, do

<% If fp_rs("sold") = True then %><img src="sold.gif"><% Else %><img src="<%=fp_rs("image")%><% End
If %>

Both of the above requires that you manual code this into your page in HTML / Code View.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
C

CJ

Why hide the photo, place the word SOLD above or below the photo?
<% If fp_rs("sold") = True then %>SOLD<% End If %>

where ever you want the word to be displayed.

To swap the photos, do

<% If fp_rs("sold") = True then %><img src="sold.gif"><% Else %><img
src= said:
If %>

Both of the above requires that you manual code this into your page in HTML / Code View.

Thanks, I'll give that a try.
 
C

CJ

Thanks, I'll give that a try.
Perhaps I'm being stupid, but I just couldn't get that to work - it just
gave me two images side-by-side. I'm a little confused as to the use of the
fp_rs("sold") - presumably I just replace this with the actuall value of the
field, i.e. fp_rs("Sold, STC") - or do I change fp_rs to the field name?

I've tried (and failed!) to do this at http://www.mymea.co.uk/search_4d.asp

If you do have a chance to take a look I'd be very grateful.

CJ
 
T

Thomas A. Rowe

Can you paste section of your code where you are displaying the images?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
C

CJ

Can you paste section of your code where you are displaying the images?

<% If fp_rs("Sold, STC") = True then %><img src="/photos/sold.jpg"><% Else
%><img
src="<%=fp_rs("/photos/<%=FP_FieldLink(fp_rs,"PhotoOneURL")%>.jpg")%><% End
If %>

I'm probably being dim. Thanks.
 
T

Thomas A. Rowe

Ok, the following assumes that "STC" is a Yes/No field in the database set to use True/False and not
Yes/No as the values, and the STC is also the field that indicates it the property is sold or not.

<% If fp_rs("STC") = True then %>
<img src="/photos/sold.jpg">
<% Else %>
<img src="/photos/<%=fp_rs("PhotoOneURL")%>.jpg">
<% End If %>

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
C

CJ

Ok, the following assumes that "STC" is a Yes/No field in the database set
to use True/False and not
Yes/No as the values, and the STC is also the field that indicates it the property is sold or not.

<% If fp_rs("STC") = True then %>
<img src="/photos/sold.jpg">
<% Else %>
<img src="/photos/<%=fp_rs("PhotoOneURL")%>.jpg">
<% End If %>

OK, I can see how that works, the complicating factor is that "Sold STC" is
one possible value of the Status field. Other values include "For Sale" ,
"Under Offer" etc. The sold photo is to be displayed when Status="Sold STC".

So perhaps I want something like:

<% If fp_rs("Status") = "Sold STC" then %> <img src="/photos/sold.jpg"> <%
Else %> <img src="/photos/<%=fp_rs("PhotoOneURL")%>.jpg"> <% End If %>

That might work.

Thanks a lot for your help, by the way.
 
T

Thomas A. Rowe

OK, then testing for "Sold STC" will work.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
T

Thomas A. Rowe

You are welcome!

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
Top