<% function PreviousMessage(ByRef pobjCon, ByVal pintMessageID, ByVal pintGroupID, ByVal pintUserID, _ ByVal pblnShowActive, ByVal pblnShowArchived, _ ByVal pblnShowApproved, ByVal pblnShowUnapproved, _ ByVal pblnHideRead) 'gets the next messageID, returns 0 if there is no next message. dim objRs, blnRead PreviousMessage = 0 ' default return value set objRs = ListMessagesForGroup(pobjCon, pintGroupID, pintMessageID, pintUserID, _ pblnShowActive, pblnShowArchived, _ pblnShowApproved, pblnShowUnapproved, _ pblnHideRead) if not objRs.BOF then objRs.movefirst objRs.Find("ID=" & pintMessageID) if not objRs.BOF then objRs.MovePrevious if pblnHideRead and pintUserID>0 then 'skip read messages do while not objRs.BOF blnRead = objRs.Fields.Item(13)>0 if isnull(blnRead) then blnRead = false if not blnRead then exit do objRs.MovePrevious loop end if if not objRs.BOF then PreviousMessage = objRs("ID").Value ' return next message ID end if end if objRs.close set objRs = Nothing end function %>