Skip to main content
Participant
June 15, 2006
Answered

Inserting an image from a Y value in an Access field

  • June 15, 2006
  • 2 replies
  • 249 views
Using ASP/VBscript and Access
I'm making a page that dislays a listing of organisations (using Repeated Regions) concerned with disabilities. I want to use images for symbols that indicate whether, for example, an organisation uses textphones, has wheelchair access, and the like. I'm using a form to add new records to the database. I want the form to allow users to select the applicable symbols using checkboxes. What code will allow the listing page to interpret a Y value as an image path and ignore a N value.
Thanks
This topic has been closed for replies.
Correct answer Newsgroup_User
Assuming that you have text fields storing the Y N then on the output you
have a code block like this

<%
If recordset.fields.item("wheelchair").value = "Y" then
%>
<img src="images/wheelchair.gif">
<%End if%>

However is your field is set to be a Yes/No type then the best way is to
write the test like this

If recordset.fields.item("wheelchair").value = TRUE then


--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"Lancs" <webforumsuser@macromedia.com> wrote in message
news:e6srl5$jul$1@forums.macromedia.com...
> Using ASP/VBscript and Access
> I'm making a page that dislays a listing of organisations (using Repeated
> Regions) concerned with disabilities. I want to use images for symbols
> that
> indicate whether, for example, an organisation uses textphones, has
> wheelchair
> access, and the like. I'm using a form to add new records to the database.
> I
> want the form to allow users to select the applicable symbols using
> checkboxes.
> What code will allow the listing page to interpret a Y value as an image
> path
> and ignore a N value.
> Thanks
>


2 replies

LancsAuthor
Participant
June 16, 2006
That works a treat. Thanks very much (for the 2nd time in 2 days)
Newsgroup_UserCorrect answer
Inspiring
June 16, 2006
Assuming that you have text fields storing the Y N then on the output you
have a code block like this

<%
If recordset.fields.item("wheelchair").value = "Y" then
%>
<img src="images/wheelchair.gif">
<%End if%>

However is your field is set to be a Yes/No type then the best way is to
write the test like this

If recordset.fields.item("wheelchair").value = TRUE then


--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"Lancs" <webforumsuser@macromedia.com> wrote in message
news:e6srl5$jul$1@forums.macromedia.com...
> Using ASP/VBscript and Access
> I'm making a page that dislays a listing of organisations (using Repeated
> Regions) concerned with disabilities. I want to use images for symbols
> that
> indicate whether, for example, an organisation uses textphones, has
> wheelchair
> access, and the like. I'm using a form to add new records to the database.
> I
> want the form to allow users to select the applicable symbols using
> checkboxes.
> What code will allow the listing page to interpret a Y value as an image
> path
> and ignore a N value.
> Thanks
>