|
-
Sep 26th, 2003, 01:05 AM
#1
Thread Starter
Registered User
Exit Sub
I am trying to make it so it will just exit the sub if there is nothing else to be deleted.
Private Sub DeleteItem()
Dim j As String
Dim f As String
If rs.RecordCount <> 0 Then
Exit Sub
Else
f = MsgBox("Are you sure?", vbYesNo + vbExclamation, "Delete Current Item?") 'Confirms the deletion
If f = vbYes Then 'If Yes is clicked then it will delete the current item in lstserial
j = lstItems.SelectedItem.Text 'j is a string for the text in the lstserial
SelectData "List", "Applicaton", j 'This opens the data base and seaches for the selected item in the lstserial and deletes in the lstserial
On Error Resume Next
rs.Delete 'Deletes recordset in database
InitDB "List", "Db.mdb", "Applicaton" 'This indeacates what Database, the list and what name
Fill_ListView 'Fills lstserial with the records in the database
Else
Exit Sub
End If
End If
End Sub
-
Sep 26th, 2003, 01:11 AM
#2
-= B u g S l a y e r =-
use vbcode tag
hi there s3cur17y
please use the vbcode tag when posting code... makes it readable 
[vbcode]
MsgBox "u'r code goes here"
[/vbcode]
will look Like this
VB Code:
MsgBox "u'r code goes here"
-
Sep 26th, 2003, 01:15 AM
#3
Thread Starter
Registered User
<vbcode>
if this work = True Then
msgbox "Good!"
end if
</vbcode>
VB Code:
if this work = True Then
msgbox "Good!"
end if
vbcode
if this work = True Then
msgbox "Good!"
end if
/vbcode
-
Sep 26th, 2003, 01:17 AM
#4
Thread Starter
Registered User
Vb Code Laidout
Exit Sub
I am trying to make it so it will just exit the sub if there is nothing else to be deleted.
VB Code:
Private Sub DeleteItem()
Dim j As String
Dim f As String
If rs.RecordCount <> 0 Then
Exit Sub
Else
f = MsgBox("Are you sure?", vbYesNo + vbExclamation, "Delete Current Item?") 'Confirms the deletion
If f = vbYes Then 'If Yes is clicked then it will delete the current item in lstserial
j = lstItems.SelectedItem.Text 'j is a string for the text in the lstserial
SelectData "List", "Applicaton", j 'This opens the data base and seaches for the selected item in the lstserial and deletes in the lstserial
On Error Resume Next
rs.Delete 'Deletes recordset in database
InitDB "List", "Db.mdb", "Applicaton" 'This indeacates what Database, the list and what name
Fill_ListView 'Fills lstserial with the records in the database
Else
Exit Sub
End If
End If
End Sub
-
Sep 26th, 2003, 01:21 AM
#5
-= B u g S l a y e r =-
VB Code:
If rs.RecordCount = 0 Then
would that do it ?
-
Sep 26th, 2003, 01:41 AM
#6
Frenzied Member
VB Code:
If rs.EOF Then
Exit Sub
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|