Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    delete from combo box (Access 2000)

    Why deletion from a combo box is not working ? I have a control in my form called productid. In the onClick event of this control i have :
    Dim StrSQL As String
    StrSQL = "DELETE * FROM [order details1] WHERE ProductID = " & Me!productid & ";"
    CurrentDb.Execute StrSQL

    When i change the control from a text box into a combo box nothing happens and no deletion occurs.However when i change again from como box into a text box the deletion is OK. How can i make the onclick event work also with the combo box ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: delete from combo box (Access 2000)

    You must add a line to requery the combo box after executing the SQL:

    Me.NameOfComboBox.Requery

    This forces Access to refresh the list of items in the combo box.

Posting Permissions

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