Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Delete Item From Listview Box?


sorry, but I've another question on listview!

I know now how to get a selected item within a populated listview box, what I'd like to know now is is it possible to delete an entry in listview and then move up the items below it?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Delete ListView Item
Is this not the way to delete a selected ListView Item?

Code:
If Form4.STlv.ListItems.Count > 0 Then
a = Form4.STlv.SelectedItem
Form4.STlv.ListItems.Remove a
Call SaveList
EndIf

How To Delete Item On Listview
how do i delete a row on the listview? suppose i click on 1 row and i want to delete it...

Delete Item In Listview Control
Hi there, this is my scenario, (I'm using Access ND VBA)

I add and item(+ subitems) to the Listview control here is my code:


Code:
If Me.Caption = "Add New Material" Then
Set itmx = Forms!CopyAddModifyShoppingList!LvwMaterialRequirements.ListItems.Add()

'Set itmx = Forms!CopyAddModifyShoppingList!LvwMaterialRequirements.ListItems.Add(, , CStr(Me.cboMaterials.Column(0))) ' Variable = MaterialsRef
itmx.Text = Me.cboMaterials.Column(0)
itmx.SubItems(1) = Me.cboMaterials.Column(1) ' Variable = MaterialsDescription
itmx.SubItems(2) = Me.txtNumber ' Variable = MaterialsNumber
Else
Set itmx = Forms!CopyAddModifyShoppingList!LvwMaterialRequirements.ListItems.Add()
itmx.Text = Me.cboMaterials.Column(0)
'Set itmx = Forms!CopyAddModifyShoppingList!LvwMaterialRequirements.ListItems.Add(Me.cboMaterials.Column(0), , 0) ' Variable = MaterialsRef
itmx.SubItems(1) = Me.cboMaterials.Column(1) ' Variable = MaterialsDescription
itmx.SubItems(2) = Me.txtNumber

'ListViewIndex ListView1.SelectedItem
sdfsdf = Forms!CopyAddModifyShoppingList!LvwMaterialRequirements.Items.Remove(Forms!CopyAddModifyShoppingList!LvwMaterialRequirements.SelectedItem)
End If
Set itmx = Nothing

What I'm trying to do is this:

(1) Get the item selected and modify it(using other forum), this is done

(A) I want to add the modified item in the same position as before,
(B) When a is done remove the selected item plus one.

But I cannot get this to work no matter what I do.

the pig..

Delete Selected Item In Listview ?
I thought it would be something like,

Me.ListView1.SelectedItem.Clear , but nope ?

Delete ListView Item In Binary File
I need to Delete the Selected Item in a ListView and as well as in a stored Binary. Can somebody help me with an example. Here is a brief summary.

I select the Items in a ListView. These can be multiselect. Then one by one I read the first Index value of this Item which is also the same Index value I stored in Binary File. So this way I identify the specific Record in the Binary File.

Now here comes the difficult task that how I delete this Record in Binary File. I know that I can read this particular record by GET statement but then how will I delete it. And also If I able to delete it then how I change the Record number of all other preceding Records, since the Record number need to change for all other Record after the deleted Record.

This is a very common use in many application where user select multiItems and delete it in the ListView and as well as in the storage File. I just do not underdtand. I really tried many ways and searched VB Help in Application, but no success. Can somebody help. Thanks.

Delete Multiple Item From Database Through Listview
hi all

plzzzz help me,i want to delete multiple item from database through listview with checkbox property is true.If possible then plzzzzz give me some code for that.

thankx in advancce

Delete ListBox Item When Hit Delete From Keyboard
i want to delete an item that is selected in a listBOx when the delete button of the keyboard is hit. In order to do that i need to be able to first select an item in a listBox, however my click function doesn't seem to respond because there is a conflict with the right-click action. This is the response i had got from codeguru previously:

http://www.codeguru.com/forum/showth...7&goto=newpost

so how shud i solve that and also how can i select multiple entries in the listBox through the shift down arrow

Click Item In Listview Then Show That Item In Combo As Index = 0
Hi guys,

I have a listview (lvwUserPunchedOut) that is populated with records in a database (persons first name in one column and last name in the second column), what I am looking to do is if I select a persons name by clicking on it in the listview on frmMain, and then bring up frmSearchCriteria, i would like to show that selected name in the combobox as default (cboEmployee.ListIndex = 0) on frmSearchCriteria (the combobox is sorted = True and is also populated with first name and last name of the person)

How would this be done? Hope I make sense. Thanks in advance.

Solved-howto Send First Item Of Listbox Totextbox, Then Delete First Item Of Listbox?
Lol another question, how do you do this

how to send first item of listbox to textbox, then delete first item of listbox?

Thanks

Moving A Listview Item And Its Subitems To A New Listview
Hey Guys,

Having a bit of trouble. I am attemping to move a selected item and its subitems from one listview to another. I have no problem getting the contents of the first column, but I can't seem to get the subitems over.

Example: I have this in the first listview:

Code:
|Item |Quanity|Price |PQ |
Bananas 2 $.50 $1.00

Then when I try to move that whole row to the other listview I can only seem to get this:

Code:
|Item |Quanity|Price |PQ |
Bananas

No subitems . Any links or help would be appreciated.

Regards,

Max_Power

How Can I Delete An Item?
hi i have ListView1. how can i delete an item by double clicking it (the selected item). if i ve double click an item this item will automatically delete or a message box appear then delete item from my ListView1. TIA

Delete Item In Startup...
when i install my app, i put them in the msconfig thingy so it will start when window start, but how i do to delete them when i uninstall my app ?
thanks

Treeview Delete Item
Hi All,

I have a treeview which when I select a item from it I can delete it like so


Code:
TreeView1(0).Nodes.Remove (TreeView1(0).SelectedItem.Index)
but how can I do a test to see if the parent is selected or not if so do not delete anything also a test to see if any item has been selected?

Thanks

Loftty

Delete Item Errors
I am trying to delete a specific item from an access database.
When I try the following code I get this error "no value given for one or more required parameters".
Can anyone tell me what I am missing?
Thank you in advance

Michael


Code:
Private Sub cmdDelete_Click()
Dim mySQL As String
Dim objrs As New ADODB.Recordset
Dim objcmd As New ADODB.Command
mySQL = "DELETE * FROM Equipment WHERE EquipName = '~Name~' AND EquipCategory = '~Category~' AND EquipUser = '~User~'"
mySQL = Replace(mySQL, "~Name~", g_sysUser)
mySQL = Replace(mySQL, "~Category~", g_sysEquip)
mySQL = Replace(mySQL, "~User~", g_sysUser)

objcmd.ActiveConnection = g_Conn
objcmd.CommandType = adCmdText
objcmd.CommandText = mySQL
Set objrs = objcmd.Execute

End Sub

Listbox Delete Item
Hello all,


I have a list box and I want to delete an item by pressing 'delete'

My code only works with backspace... What can I do?


VB Code:
Private Sub lst1_KeyPress(KeyAscii As Integer)    If lst1.ListCount > 0 Then        If KeyAscii = 8 Then            lst1.RemoveItem lst1.ListIndex        End If    End IfEnd Sub


I supose that ascii code for delete key is 127... but if you press 'delete', the event lst1_KeyPress don't catch it...

Thanks

Delete An Item From An Array
Hi
I have an array of string Names()
Names("James","Tony","Elie"..)
If I want to delete "Tony" from the array,so Names will become("James","Elie",...)
How can I do it by code?
thanks

How Delete Item From Flexgrid
hi friends

I have a problem. I have two table. Both table have a one same field. Field name is Serial. in one table only serial field and other table table have more data with one serial field. like

Table1
Serial
1001
1002
1004

Table2
Serial Item Code
1001 Male 1
1001 Male 2
1001 Male 3
1001 Male 4
1001 Male 5
1001 Male 6
1001 Male 7
1001 Male 8
1001 Male 9
1001 Male 10

now problem is if i choose serial from combobox and put these code onto flexgrid then how can i delete entered record which is present in flexgrid.
plzzzz tell me

I m waiting


thankx in advance

Delete Item From ImageCombo!
How do I delete the very first item from a ImageCombo?

How To Delete A Item From The List?
Hey

I need to put a command button on my program that will remove the 'Selected' item from my List1.List..

Does anyone know how to do that? It should be pretty easy (MAYBE )

Thanks!

Treeview Delete Item
Hi All,

I have a treeview which when I select a item from it I can delete it like so


VB Code:
TreeView1(0).Nodes.Remove (TreeView1(0).SelectedItem.Index)


but how can I do a test to see if the parent is selected or not if so do not delete anything also a test to see if any item has been selected?

Thanks

Loftty

How Do I Delete The First Item In A Listbox?
it doesnt work for me, i tried this:


VB Code:
lstItems.RemoveItem 1


but that didnt work, can someone help me?

ListBox Delete Item
Anyone have any idea why this code doesn't work?
VB Code:
Private Sub List1_KeyPress(KeyAscii As Integer)    If KeyAscii = vbKeyDelete Then List1.RemoveItem List1.ListIndexEnd Sub

Delete Item From Listbox?
I know how to add items to a list box but how do i delete an item. For an example lets us the selected item. Thanks

Delete Item From Listbox
How can I delete an (selected) item from a listbox ?
I have a listbox, filled with file-names, I select one of the items and with a commandbutton I will delete (kill or move) this file. What do I have to do ??

Regards, K. Lensen

Delete Last Item In An Array
Hi,

Each time a user opens my workbook I create an array of projects from the main worksheet. The user is then able to delete and edit the projects using user forms.

My problem arises when the user deletes all of the projects, can someone please tell me how to delete the last element in an array?

Thanks
A

Help: Delete Duplicate Item***
original listbox as below:


AAA=8
BBB=6
CCC=9
DDD=7
AAA=A
EEE=8

after i click the cmdDuplicate i wish the listbox contents will become:

BBB=6
CCC=9
DDD=7
AAA=A
EEE=8


please note that AAA=8 to be deleted. The deletion will base on the string before the "=" sign. Example AAA repeated, then the later existed AAA will be retained while the first appear AAA will be deleted.

below code fails as it cant

Code:Private Sub Form_Load()
lstDuplicate.AddItem "AAA=8"
lstDuplicate.AddItem "BBB=6"
lstDuplicate.AddItem "CCC=9"
lstDuplicate.AddItem "DDD=7"
lstDuplicate.AddItem "AAA=A"
lstDuplicate.AddItem "EEE=8"
End Sub

Private Sub cmdDuplicate_Click()
    Dim intDu As Integer
    For intDu = 0 To lstDuplicate.ListCount - 1
        If lstDuplicate.List(intDu) = lstDuplicate.List(intDu - 1) Then
            lstDuplicate.RemoveItem (intDu)
        End If
    Next intDu
End Sub

How Do You Delete An Item From A List Box?
Hi everyone,
Quick question, How would you delete a selected item from a listbox with a delete button?


I have figured out how to Populate the list box by clicking an ADD button.

Private Sub cmdAdd_Click()
ListB.AddItem Text4.Text
End Sub

If I keep clicking the button it will add to the list, which is desired.


Thank you for any sugguestions.

My Application Cannot Delete Last Item In FG
I am getting a CAN NOT REMOVE LAST NON-FIXED ROW

I am getting this error only when I try to delete the last item on the gird. My program can successfully duplicate, copy and add rows. Please let me know if u want any further info

THANKS ALOT !!!!!


***** I am getting the error in the Command2 sub.*****

[CODE]
Private Sub Command2_Click()

FGActions.RemoveItem (FGActions.Row)

End Sub

******Here is some other relavant code******

Private Sub FGActions_DblClick()


With FGActions
GCol = .Col
GRow = .Row

If .Row <> 0 And .Col < 2 Then
CellText.Top = .CellTop + .Top
CellText.Left = .CellLeft + .Left
CellText.Height = .CellHeight
CellText.Width = .CellWidth
CellText.Text = .Text
CellText.Visible = True
CellText.SetFocus
End If
If .Row > 0 And .Col = 3 Then
If .Text = "Running" Then
.Text = "Shut down"
Else
.Text = "Running"
End If
End If
If .Row > 0 And .Col = 2 Then
Combo2.Visible = True
Combo2.Top = .CellTop + .Top
Combo2.Left = .CellLeft + .Left
'Combo2.Height = .CellHeight
Combo2.Width = .CellWidth

End If

End With

End Sub
***********************

Private Sub FileLoad_Click()
CD.DialogTitle = "Enter the MPS file name and location..."
CD.Filter = "MS Access Database Files (*.mdb)|*.mdb|All Files (*.*)|*.*"

CD.ShowOpen
temp2 = CD.filename
If temp2 = "" Then
StatusBar1.Panels(2).Text = "Filename not valid. Operation aborted."
Call FileClose_Click
Exit Sub
Else
GlobalVar.MainDBName = temp2
End If

LoadExistingFMEA temp2
LoadAssemMainTree temp2, Combo1.Text
LoadATeamGenInfo temp2

MPSMain.Caption = "Maintenance Policy Setting (Database in use: " & GlobalVar.MainDBName & ")"

Delete Single Item From History
how could i delete a single file from the internet history?
im looking for a function that would internally find the temp inet files folder rather than using a simple kill function, since i want the code to be flexible if the temp file location changes.
or i need a way to get the location of the temp inet folder so i can send a kill command to the file.
thx for any help

Recordset Item Delete Error
Hi,

I am trying to delete an item in a recordset and it gives the following error

Object or Provider is not capable of performing requested task.

The database is access.

I can't do anything to the recordset like delete, addNew and stufff like that.
I have only attached the Microsoft ActiveX Data Objects 2.5 library

Where i try to delete the item is in cmdDelete_Click()

Please help me. I have no idea what the hell is happening here.


Following is the code,


Code:
Option Explicit

Private db As ADODB.Connection
Dim rs As Recordset
Public uid As String
Public pwd As String
Public dBase As String
Dim text, mli As String
'Dim mli As String


Private Sub cmbMLI_Click()

mli = cmbMLI.text
'Set rs = New ADODB.Recordset
Set rs = db.Execute("select * from MSOT_MLIS where " & _
"MLI = '" + mli + "'")
txtDiscrip.text = rs.Fields("MLIDESC").Value
'Print text
End Sub


Private Sub cmdAdd_Click()
If cmbMLI.text = "" Then
MsgBox "Please Select MLI", vbInformation
Exit Sub
End If
End Sub

Private Sub cmdClose_Click()
Dim intTmpMsg As Integer
If cmbMLI.text = "" Then
Unload Me
Exit Sub
End If
intTmpMsg = MsgBox("Close and Save the Changes? ", vbYesNo, "Close")
If intTmpMsg = 6 Then
Unload Me
End If

End Sub

Private Sub cmdDelete_Click()
Dim intTmpMsg As Integer
Dim StrTmp As String
Dim strInt As Integer

If cmbMLI.text = "" Then
MsgBox "Please Select MLI", vbInformation
Exit Sub
End If
StrTmp = cmbMLI.text
intTmpMsg = MsgBox("Are you sure you want to delete the MLI", vbYesNo,
"Delete MLI")
If intTmpMsg = 6 Then
'If Not rs.EOF Then
' Set rs = db.Execute("select * from MSOT_MLIS where " & _
"MLI = '" + mli + "'")
rs.Delete
cmbMLI.RemoveItem cmbMLI.ListIndex
txtDiscrip.text = ""
'End If
End If
'If rsORA = "Null" Then
' cmbMLI.Clear
' Exit Sub
'Else
' MsgBox (rsORA)
'End If
' Combo1.Clear
' Combo1.Refresh
' Exit Sub
'Errhandler:
'MsgBox Err.Description
'Exit Sub
End Sub

Private Sub cmdEdit_Click()
If cmbMLI.text = "" Then
MsgBox "Please Select a MLI", vbInformation
Exit Sub
End If
End Sub

Private Sub Form_Load()

Dim Conn As String

uid = "budhagru"
pwd = "rusara14623"
dBase = "schory19"
Set db = New ADODB.Connection

'db.ConnectionString = "UID= " & uid & ";PWD=" & pwd &
";DRIVER={Microsoft ODBC For Oracle};" _
& "SERVER=" & dBase & ";"
'db.Open

db.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "MLI.MDB;" & _
"Persist Security Info=False"



' Set rs = New ADODB.Recordset
'rs.Open "select * from TBMSO_MSOT_MLIS ORDER BY MLI", db
Set rs = db.Execute("select * from MSOT_MLIS ORDER BY MLI")
'MLI List
If Not rs.EOF Then rs.MoveFirst
Do While Not rs.EOF
cmbMLI.AddItem rs!mli
rs.MoveNext
Loop

' If cmbMLI.ListCount > 0 Then
' cmbMLI.ListIndex = 0
' End If

rs.Close
End Sub

Delete Last Item In Dynamic Array
hihi everyone... a easy array qn again.... juz wanna ask how to delete the last item in a dynamic array... for example if there is 4 indexes, after deleting there shld be 3 indexes..... appreciate ani help...

Delete Item From A ComboBox At Runtime
I have a form with a combobox for types of items. The list is populated from the database and I have it set so the user can enter a new item and it automatically adds the new item to the list so the next time they try to enter the item it is already in the combobox and they don't have to re-enter the data.

If the user selects an item in the combobox and right-clicks on the item a standard pop-up menu appears with copy, cut, paste, delete and if the user selects clicks on delete the entry disappears.

My problem is that I can't figure out which event is taking place so I can insert the code to update the list.

Does anyone know how to recognize the delete item from the pop-up menu ???

Thank you for any suggestions or help you can give me.

Jenn

Delete Item From Data Grid
Can someone tell me how to delete an selected item that is appear in data grid?

Delete Selected Item In Listbox?
Now I need a little help with deleting a item in the list box.

so the name that is highlighted I wanna remove from the item list but only that item not the whole list.

Thanks !

Delete Selected Item In The Gird..
Hi all
I am using VSFlexGrid in my project
It has three field first field is Boolean user has a option that he is able to delete the sleeted grid row..
I trying from 1 hour but my code showing error in last can any one please help me
Thanks!!

This is my first code

VB Code:
For I = 1 To Grid.Rows - 1If Grid.Cell(flexcpText, I, 0) = -1 Then Grid.RemoveItem (I) ': I = I + 1Next

This is my second code

VB Code:
A = 0While A <> Grid.Rows    If Grid.Cell(flexcpText, A, 0) = -1 Then Grid.RemoveItem (A)    A = A + 1Wend


Both showing last time an error

Here GRID is the VSFLEXGRID

thanks

Delete Listbox Item From Database
hi,

I am missing something here?
My code is shown, I am trying to delete a record from list box and database by pressing the delete key and is not working.

Thanks


VB Code:
Private Sub lstAddiotionalInfo_KeyDown(KeyCode As Integer, Shift As Integer)        Dim cmd As ADODB.Command    Dim rst As ADODB.Recordset        Set cmd = New ADODB.Command    Set rst = New ADODB.Recordset        If KeyCode = vbKeyDelete Then        On Error Resume Next            OpenConn            rst.Open "DELETE * FROM Attachments WHERE Attachment = '" & (Me.lstAddiotionalInfo.ListIndex) & "'"                With rst            .Delete adAffectCurrent            .Update                End With        Me.lstAddiotionalInfo.RemoveItem Me.lstAddiotionalInfo.ListIndex        End If        'rst.Close        'CloseConn End Sub


These are my connections to the database


VB Code:
Public Function OpenConn()     Set cn = New ADODB.Connection        With cn        .ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=Request"        .CursorLocation = adUseClient        .Open    End With    End Function Public Function CloseConn()     cn.Close    Set cn = Nothing    End Function

Delete List Item In Another Program
Can someone please give me some code that can delete a list item in another program? I'm trying to create a security program that deletes itself from the Task Manager. Please just give me a code and not ask any questions. I promise it's not for malicious purposes. Thanks

Recordset Item Delete Error
Hi,

I am trying to delete an item in a recordset and it gives the following error

Object or Provider is not capable of performing requested task.

The database is access.

I can't do anything to the recordset like delete, addNew and stufff like that.
I have only attached the Microsoft ActiveX Data Objects 2.5 library

Where i try to delete the item is in cmdDelete_Click()

Please help me. I have no idea what the hell is happening here.


Following is the code,


Option Explicit

Private db As ADODB.Connection
Dim rs As Recordset
Public uid As String
Public pwd As String
Public dBase As String
Dim text, mli As String
'Dim mli As String


Private Sub cmbMLI_Click()

mli = cmbMLI.text
'Set rs = New ADODB.Recordset
Set rs = db.Execute("select * from MSOT_MLIS where " & _
"MLI = '" + mli + "'")
txtDiscrip.text = rs.Fields("MLIDESC").Value
'Print text
End Sub


Private Sub cmdAdd_Click()
If cmbMLI.text = "" Then
MsgBox "Please Select MLI", vbInformation
Exit Sub
End If
End Sub

Private Sub cmdClose_Click()
Dim intTmpMsg As Integer
If cmbMLI.text = "" Then
Unload Me
Exit Sub
End If
intTmpMsg = MsgBox("Close and Save the Changes? ", vbYesNo, "Close")
If intTmpMsg = 6 Then
Unload Me
End If

End Sub

Private Sub cmdDelete_Click()
Dim intTmpMsg As Integer
Dim StrTmp As String
Dim strInt As Integer

If cmbMLI.text = "" Then
MsgBox "Please Select MLI", vbInformation
Exit Sub
End If
StrTmp = cmbMLI.text
intTmpMsg = MsgBox("Are you sure you want to delete the MLI", vbYesNo,
"Delete MLI")
If intTmpMsg = 6 Then
'If Not rs.EOF Then
' Set rs = db.Execute("select * from MSOT_MLIS where " & _
"MLI = '" + mli + "'")
rs.Delete
cmbMLI.RemoveItem cmbMLI.ListIndex
txtDiscrip.text = ""
'End If
End If
'If rsORA = "Null" Then
' cmbMLI.Clear
' Exit Sub
'Else
' MsgBox (rsORA)
'End If
' Combo1.Clear
' Combo1.Refresh
' Exit Sub
'Errhandler:
'MsgBox Err.Description
'Exit Sub
End Sub

Private Sub cmdEdit_Click()
If cmbMLI.text = "" Then
MsgBox "Please Select a MLI", vbInformation
Exit Sub
End If
End Sub

Private Sub Form_Load()

Dim Conn As String

uid = "budhagru"
pwd = "rusara14623"
dBase = "schory19"
Set db = New ADODB.Connection

'db.ConnectionString = "UID= " & uid & ";PWD=" & pwd &
";DRIVER={Microsoft ODBC For Oracle};" _
& "SERVER=" & dBase & ";"
'db.Open

db.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "MLI.MDB;" & _
"Persist Security Info=False"



' Set rs = New ADODB.Recordset
'rs.Open "select * from TBMSO_MSOT_MLIS ORDER BY MLI", db
Set rs = db.Execute("select * from MSOT_MLIS ORDER BY MLI")
'MLI List
If Not rs.EOF Then rs.MoveFirst
Do While Not rs.EOF
cmbMLI.AddItem rs!mli
rs.MoveNext
Loop

' If cmbMLI.ListCount > 0 Then
' cmbMLI.ListIndex = 0
' End If

rs.Close
End Sub

Recordset Item Delete Error
Hi,

I am trying to delete an item in a recordset and it gives an error regarding the following function can't perform. The database is access.

Where i try to delete the item is in cmdDelete_Click()

Please help me. I have no idea what the hell is happening here.


Following is the code,


Option Explicit

Private db As ADODB.Connection
Dim rs As Recordset
Public uid As String
Public pwd As String
Public dBase As String
Dim text, mli As String
'Dim mli As String


Private Sub cmbMLI_Click()

mli = cmbMLI.text
'Set rs = New ADODB.Recordset
Set rs = db.Execute("select * from MSOT_MLIS where " & _
"MLI = '" + mli + "'")
txtDiscrip.text = rs.Fields("MLIDESC").Value
'Print text
End Sub


Private Sub cmdAdd_Click()
If cmbMLI.text = "" Then
MsgBox "Please Select MLI", vbInformation
Exit Sub
End If
End Sub

Private Sub cmdClose_Click()
Dim intTmpMsg As Integer
If cmbMLI.text = "" Then
Unload Me
Exit Sub
End If
intTmpMsg = MsgBox("Close and Save the Changes? ", vbYesNo, "Close")
If intTmpMsg = 6 Then
Unload Me
End If

End Sub

Private Sub cmdDelete_Click()
Dim intTmpMsg As Integer
Dim StrTmp As String
Dim strInt As Integer

If cmbMLI.text = "" Then
MsgBox "Please Select MLI", vbInformation
Exit Sub
End If
StrTmp = cmbMLI.text
intTmpMsg = MsgBox("Are you sure you want to delete the MLI", vbYesNo,
"Delete MLI")
If intTmpMsg = 6 Then
'If Not rs.EOF Then
' Set rs = db.Execute("select * from MSOT_MLIS where " & _
"MLI = '" + mli + "'")
rs.Delete
cmbMLI.RemoveItem cmbMLI.ListIndex
txtDiscrip.text = ""
'End If
End If
'If rsORA = "Null" Then
' cmbMLI.Clear
' Exit Sub
'Else
' MsgBox (rsORA)
'End If
' Combo1.Clear
' Combo1.Refresh
' Exit Sub
'Errhandler:
'MsgBox Err.Description
'Exit Sub
End Sub

Private Sub cmdEdit_Click()
If cmbMLI.text = "" Then
MsgBox "Please Select a MLI", vbInformation
Exit Sub
End If
End Sub

Private Sub Form_Load()

Dim Conn As String

uid = "budhagru"
pwd = "rusara14623"
dBase = "schory19"
Set db = New ADODB.Connection

'db.ConnectionString = "UID= " & uid & ";PWD=" & pwd &
";DRIVER={Microsoft ODBC For Oracle};" _
& "SERVER=" & dBase & ";"
'db.Open

db.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "MLI.MDB;" & _
"Persist Security Info=False"



' Set rs = New ADODB.Recordset
'rs.Open "select * from TBMSO_MSOT_MLIS ORDER BY MLI", db
Set rs = db.Execute("select * from MSOT_MLIS ORDER BY MLI")
'MLI List
If Not rs.EOF Then rs.MoveFirst
Do While Not rs.EOF
cmbMLI.AddItem rs!mli
rs.MoveNext
Loop

' If cmbMLI.ListCount > 0 Then
' cmbMLI.ListIndex = 0
' End If

rs.Close
End Sub

How To Delete Selected Item At The Listbox.
Hi everyone,

 I have two list boxes. one of them is for item another one is for price.
example
    Hamburger    $3.00
    Chicken Nugget    $2.00
    Muncher        $1.50

for example the above items are added to the listbox after clicking the picture. if i dont want the chicken nugget, how can i sure when i select it, the value in the two list box are deleted/remove from the list box.

Thank you. all of you in here are great help to me.

from
swatchgal

How To Delete The Selected Item In The Textbox
Hi

 I need some help here. if my textbox has many items and i wanted to erase only certain selected items. what method shoud i use? what is the code to be implement? Thank you

from
swatchgal

How To Delete A LisBox Item Withou Use The Index?
Hi VB programers:

I'd like to know how to delete a listbox item without use the item index?

-------------------
Ex:

ExtSpa.RemoveItem (Var ?)

---------------------

Thank you.

Delete Blank Item From List1.List
I have a few blank lines in a listbox and need to delete them, how can I set it up to where if the listbox has a blank in it, it deletes it??

Select Item From Listbox And Delete It From The Txt File
hi...

how can i delete an item which i selected in a listbox from the file which i opened in this listbox?? I've tryed but i can't get the right line number out of the txt file....

Refresh Button And Combo Box Item Delete
Hi Expert,

I have 2 questions regarding VB 6 :

1. How to create refresh Button in the form? I have combo box with the
data linked to Access database. I create another form for data input for
those that appear on the combo box. When I close the input form, I
realise that the data is not yet appear on the combo box. I have to
close the first form, then open again. Then the data had included on the
combo box. Instead of doing this thing, I believe refresh button will
help a lot.

2. what is the syntax to delete the text appear on the combo box? In
this case, my combo box linked to recordset as "Payment". So, by clik a
command button, then the specific text which I choose in the combo box
deleted. Can anybody advise?

Thank you/
Teddy

Delete An Item From A Datacombo Related To A Database
Hello!
I'm a new user of this forum.
I have a datacombo connected to a specific database, and I want to select a item of that datacombo and erase it from that database. I can't delete the select item on datacombo that is linked to the database.
I'm using adodc controls.

If anyone could help me I apreciate

Rfcb

Multiselect Item In Listview1 Delete From Access Database
hi i want to delete all my selected items in listview from my access database

i can delete only 1 item in my database by this code:

Code:
cn.Execute "DELETE FROM tblTxtMsg WHERE TxtMsg = '" & (Listview1.SelectedItem.Text) & "'"
Call listRefresh




and i can delete all selected items on my listview by this code:

Code:
Dim i As Long
With Listview1
For i = .ListItems.Count To 1 Step -1
If .ListItems(i).Selected Then
.ListItems.Remove (i)
End If
Next i
End With



but I can't delete all selected items in my database. Any idea or sample code please !!

Copyright © 2005-08 www.BigResource.com, All rights reserved