I know where the problem is but i just cannot get past it, please help me and tell me why I get the error message:

Microsoft JET Database Engine (0x80040E07)
Data type mismatch in criteria expression. (line 71)

<%
dim vendmsg
dim messagedate
dim sql
dim idnumber
rs.source = "SELECT * FROM Messages WHERE VendNum = '" & VendNumb & "';"
rs.open()
do while not rs.eof
if rs.recordcount > 0 then
idnumber = rs("IDNum")
vendmsg = rs("Message")
messagedate = rs("DateCreated")
todaysdate = date()
rs.close
sql = "UPDATE Messages SET DateDisplayed = '" & todaysdate & "' WHERE VendNum = '" & VendNumb & "' AND IDNum = '" & idnumber & "';"
rs.open(sql)
else
vendmsg = "You have no new messages."
messagedate = date
end if
response.Write("<font color=#cc0000 size=4 face=Georgia>" & messagedate & "<BR>" & vendmsg & "<BR><br>")
rs.movenext()
loop
%>