Deleting messages

Results 1 to 2 of 2

Thread: Deleting messages

  1. #1
    Ravikiran Guest

    Default Deleting messages

    I need to delete messages displayed from a table. i have to give the user an option to select them and delete them if needed(just like in email application where he can select some messages and delete them if he does not want).Like that i have to delete the messages if the message is checked.PLease help

  2. #2
    Join Date
    Dec 1969

    Default RE: Deleting messages

    *<BR>If you have 3 checkboxes with values 1, 2, 3 showing the messages to be selected and later deleted :<BR><BR>1 Message1<BR>2 Message2<BR>3 Message3<BR><BR>and a Delete Button, try the follwoing code:<BR><BR>Dim strMID &#039String that holds messageIDs<BR>If Request("Delete") &#060;&#062; "" Then<BR> For Each element in Request.Form<BR> If element &#060;&#062; "Delete" AND Request.Form(element) &#060;&#062; "" Then<BR> If strMID &#060;&#062; "" Then strMID = strMID & ","<BR> strMID = strMID & Request.Form(element)<BR> End If<BR> Next<BR>End If<BR>&#039Now strMID should contain "1,2,3" if user has <BR>&#039selected all checkboxes<BR>&#039Try this SQL for deleting <BR><BR>"Delete from tblMessages Where MessageID IN (" & strMID & ")"<BR><BR>Hope this would help.<BR><BR>ArakkotSurendran<BR>(surendran@alnade<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts