My 2 cents, I believe the LimitToList data property must be set before the NotInList event will trigger. Probably the reason you are getting an error is because the form cannot find the Supplier you are referring to. If it is just the name of the supplier you want then I would use something like what Tobi supplied below. If not then I would open my form in dialog mode and pass NewData as an opening argument. When you close the form you will need to requery the query driving your form so the combo box will respond correctly.
Tobi - You can shorten your code by using: If vbYes = MsgBox("Do you wish to add " & NewData & " as a new supplier", vbQuestion + vbYesNo, "Not in List" Then strS = "INSERT INTO tblTitles ( Title ) SELECT '" & NewData & "' AS Expr1;" DoCmd.RunSQL strS Response = acDataErrAdded ' you want this after you add the supplier to your table as this will requery your query. ' I believe if you have it before adding to your table you will still get a NotInList error. Else Response = acDataErrContinue End If Glenn P. Jones IHS -----Original Message----- From: AccessDevelopers@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Hoffman, Tobi K (DYS) Sent: Thursday, 05 January, 2006 14:07 To: AccessDevelopers@yahoogroups.com Subject: RE: [AccessDevelopers] Add to Dropdown without opening a form If you only want to add the single item (and not any related data), you can add code like this to the NotInList event of the dropdown: Dim strS As String Dim intNOK As Integer Response = acDataErrContinue intNOK = MsgBox("'" & NewData & "' is not in the" & _ vbCrLf & "List of Titles. Add it?", vbYesNo, "Not in List") If intNOK = vbYes Then Response = acDataErrAdded strS = "INSERT INTO tblTitles ( Title ) SELECT '" & NewData & "' AS Expr1;" DoCmd.RunSQL strS Else Response = acDataErrContinue End If ====== If you don't want them to have to verify the addition, leave the MsgBox part out and just use the "Else" part. Tobi -----Original Message----- From: AccessDevelopers@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of lostfayth Sent: Thursday, January 05, 2006 1:57 PM To: AccessDevelopers@yahoogroups.com Subject: [AccessDevelopers] Add to Dropdown without opening a form Ok I think this is an easy one but it's plaguing me... on a form (ProjectProfile)I have a dropdown/lookup called [Suppliers]. I am trying to make it easy to add a new supplier... any suggestions? PS I've tried opening the Suppliers form using a button but I get network errors...plus.. Please zip all files prior to uploading to Files section. Yahoo! Groups Links Please zip all files prior to uploading to Files section. Yahoo! Groups Links Please zip all files prior to uploading to Files section. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AccessDevelopers/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/