Solved Trouble Refreshing cbo box upon not in list event (1 Viewer)

HillTJ

To train a dog, first know more than the dog..
Local time
Yesterday, 18:48
Joined
Apr 1, 2019
Messages
731
Friends, I intend to use 'modNotInList' to manage user additions to comboboxes. I did not write this code, but cannot remember where it came from!. I have a form 'frmOrganisations' on which is a combobox 'OrganisationCategoryID'. My intention is for the user to add a unique additional Category if not in the lookup box then have it appear in the combo box. The code works & adds the new record to 'tluOrganisationCategory', but I cannot refresh the combo on 'frmOrganisations' without closing then reopening that form. It's probably very simple & I'm keen to learn as I intend to adopt this technique on other combo boxes.. If there is a better method, then please let me know.

Please help.
 

Attachments

  • Contacts15.accdb
    3.8 MB · Views: 27

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:48
Joined
May 7, 2009
Messages
19,243
Code:
Private Sub OrganisationCategoryID_NotInList(NewData As String, Response As Integer)

Call AddNewToList(NewData, "tluOrganisationCategory", _
                             "OrganisationCategory", "Organisational Categories", "")
Response = acDataErrAdded


End Sub
 

HillTJ

To train a dog, first know more than the dog..
Local time
Yesterday, 18:48
Joined
Apr 1, 2019
Messages
731
@arnelgp , Thanks. It's that simple...I continue...
 

Users who are viewing this thread

Top Bottom