Full Version: Update main form combobox after subform delete
UtterAccess Forums > Microsoft® Access > Access Forms
bobdee
I have a main form with a combobox that acts as a filter on data in a table. When the user selects an item in the combobox a number of rows are typically returned and displayed in a subform. The user can delete the rows in the subform.
When the user has deleted all of the rows in the subform, then I need to update the combobox on the main form because these items no longer exist.
Would I use the Form_Delete on the subform? I guess I would need to do a DCount to see if there are any rows left in the table for this particular filtered item. If DCount = 0 then I would update the Parent form combobox.
Is this the best or right way to handle this or is there a better way?
Thanks.
GustiAllah
if your combobox dtsource is query related to subform recordset (table) u can do requery the combo after editing/deleting record in the subform.
bobdee
Yes, of course.
wo lines of code which includes one line to blank out the combobox value on the main form did the trick.
Thanks!
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.