Hello ,


I'm using ms access 2003, i'm trying to delete the selected data that is the name of employee, from the combobox list when i click to delete button. i'm using this code:

Private Sub cmdDelete_Click()

   For I = 0 To combobox.ListCount - 1
           
        If combobox.ListIndex(I) = combobox.Text Then
            combobox.RemoveItem (I)
            Exit For
        End If
    Next
End Sub

but its not working can anybody tell me how to delete the selected items from combobox.


Thanks and Regards

rekha

Private Sub cmdDelete_Click()
Combobox.RemoveItem (Combobox.ListIndex)
End Sub
Private Sub CmdDelete_GotFocus()
if trim(combo1.text) = vbnullstring then combo1.setfocus
End Sub

Private sub CmdDelete_Click
if trim(combo1.text) <> vbnullstring then
con.execute "Delete From EmployeeDet Where EmpName='" & trim(combo1.text) & "'"
end if
End Sub

The above all Suggestion are not working .
is here anyone who can solve this problem?

The above all Suggestion are not working .
is here anyone who can solve this problem?

How About make your own thread and post your current code..
Don't rise old thread..

The above all Suggestion are not working .
is here anyone who can solve this problem?

How About make your own thread and post your current code..
Don't rise old thread..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.