Forums

This topic is locked

Change Image for Active Record

Posted 30 Jan 2006 11:35:42
1
has voted
30 Jan 2006 11:35:42 Brad BIS posted:
I have a recordset showing a list of students. The list will eventually update grades. I want to put a photo of a student at the top of the page. As you tab through the records, the image should change relative to the current record.
Is the possible?

Replies

Replied 01 Feb 2006 02:45:30
01 Feb 2006 02:45:30 Jeremy Conn replied:
Just add a new column in your record for "Student Picture", then list it in there like: studentpic1.jpg
To display that pick, since you have obviously already created a recordset sorted by an ID or some other variable, simply place this code where your student image should go.

<img src="images/<%=(rsYourRecordset.Fields.Item("StudentPic".Value)%>" border="0">

rsYourRecordset = Should change to your recordset name
"StudentPic" = Should be whatever you named your column that stores the image path

<b>Jeremy Conn</b>
www.conncreativemedia.com
DWMX2004 | ASP/VB | Access/SQL2000
Replied 01 Feb 2006 06:24:20
01 Feb 2006 06:24:20 Brad BIS replied:
Thank you Jeremy.
Having a column with the photo in it is fine, but I actually only wanted 1 photo on the form and when you click on a textarea for a record, that one photo would change for the current record.
I managed to do this as a disjointed image swap. an onClick action on the texarea swaps the one image. It was the only wat I could think of doing it.

Thanks

Reply to this topic