0
votes

I have a form that I have placed a toggle button so the user may clear the data they've previously from three combo boxes. I've created an SQL to delete the data in the table the form is bound to, but the combo boxes are still retaining the data despite the table being clear of any data. How can I reset the combo boxes? Even when I have the form open and close, the old data is still in the combo box. I would like to reset those combos. Help!

Private Sub Reset_Company_Marketer_Product_Click()

Dim DltPrvCompMarkProd_TableSQL As String
DltPrvCompMarkProd_TableSQL = "DELETE User_SubProducts.* FROM User_SubProducts;"

DoCmd.SetWarnings False
DoCmd.RunSQL DltPrvCompMarkProd_TableSQL
DoCmd.SetWarnings True
1
These are UNBOUND combos used to enter filter criteria? Set the comboboxes to Null.June7
Fingered it a few moments after I posted: Private Sub Reset_Company_Marketer_Product_Click() Dim DltPrvCompMarkProd_TableSQL As String DltPrvCompMarkProd_TableSQL = "DELETE User_SubProducts.* FROM User_SubProducts;" Me!Company_Select_Combo = Null Me!Marketer_Select_Combo = Null Me!Product_Select_Combo = Null Company_Select_Combo.Enabled = True Marketer_Select_Combo.Visible = False Product_Select_Combo.Visible = False DoCmd.SetWarnings False DoCmd.RunSQL DltPrvCompMarkProd_TableSQL DoCmd.SetWarnings TrueCPM

1 Answers

0
votes

Private Sub Reset_Company_Marketer_Product_Click()

Dim DltPrvCompMarkProd_TableSQL As String
DltPrvCompMarkProd_TableSQL = "DELETE User_SubProducts.* FROM User_SubProducts;"
    Me!Company_Select_Combo = Null
    Me!Marketer_Select_Combo = Null
    Me!Product_Select_Combo = Null
Company_Select_Combo.Enabled = True
Marketer_Select_Combo.Visible = False
Product_Select_Combo.Visible = False

DoCmd.SetWarnings False
DoCmd.RunSQL DltPrvCompMarkProd_TableSQL
DoCmd.SetWarnings True