Hi,
Trying to use before display event to add 1 to views. similar to this forum.
this is done when accessing a detail page from the master page so when clicking onto the detail page i execute the following
// List page: Before display
Sub BeforeShowList(smarty,templatefile)
'** UPDATE a record in another table ****
set rstmp = Server.CreateObject("ADODB.Recordset")
rstmp.Open "select Views from [Communications] where ID=" & key, dbConnection
strSQLUpdate = "UPDATE Communications SET Views="&rstmp("Views")+1&" Where ID=[color=#ff0000]'"&Session(strCommunications & "_MasterKey1")&"'"
dbConnection.Execute strSQLUpdate
rstmp.Close
set rstmp = nothing
End Sub ' BeforeShowList
Views is a Number field in an Access DB at the moment if i manuall enter an ID = 27 where the red is it will work. but if i try to use the above to get the id it wont.
The error says it is not finding an ID.
Thanks for you help
Regards
Michael
V5 - 326
[/color]