I’m using a combo box to select a client name for a project.
The record source for the combo is a query on the table tblClientList, containing only an ID number (ClientID) and name (ClientName).
Making a selection from the combo store sticks the ClientID value in the table containing project information (tblSites).
I’ve used some code from the Access Developer’s Handbook (chapter 7) to deal with the Not InList event for a combo box. Their version uses an unbound control so I’ve had to modified the properties of the combo box slightly (changing the bound column to the ClientID value instead of the name) as my control is bound to the ClientID field in my table tblSites.
I’m also running an update query triggered by the After Insert event for the form.
Data is entered on different pages on a tab control on the form.
It seems to work but with a slight oddity.
If I pick a value from the combo box (a client name) a new record (in tblSites) is added, the After Insert event is fired and my query is run (populating another table with information which can then be edited on a different page on the tab control).
However when I add a new value (new client) through the combo, although a new record appears to be created (a number appears in the SiteID control -an autonumber field), the After Insert event does not appear to be triggered. Closing and re-opening the form or typing a value in another text box triggers this event.
I’m guessing I’m missing something simple like a requery, but I’m not sure.
Alternatively I’ve got the whole concept of bound columns in combo boxes wrong, any suggestions?