{"id":369,"date":"2016-07-30T23:09:33","date_gmt":"2016-07-31T03:09:33","guid":{"rendered":"http:\/\/access-diva.com\/blog\/?p=369"},"modified":"2016-07-07T23:32:14","modified_gmt":"2016-07-08T03:32:14","slug":"not-in-list-event","status":"publish","type":"post","link":"https:\/\/access-diva.com\/blog\/?p=369","title":{"rendered":"Not in List event"},"content":{"rendered":"<p>There are many examples of how to handle new entries to Combo Boxes, a.k.a. Not_In_List events.\u00a0 However, the one that is not so easily found is how to handle entries that include more than just what&#8217;s in the Combo Box.\u00a0 For example, you&#8217;re entering an Order from a new Client and you need more than just the Client&#8217;s name&#8230; you want to enter their address, phone number, etc.\u00a0\u00a0 To do that we just need to add\/open a Form and add our information&#8230;<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Private Sub cboClientID_NotInList(NewData As String, Response As Integer)\r\nOn Error GoTo Err_cboClientID_NotInList\r\n\r\n        Dim intAnswer As Integer\r\n\r\n        intAnswer = MsgBox(&quot;Would you like to add this Client to the list?&quot;, vbYesNo + vbQuestion, &quot;Not in List&quot;)\r\n\r\n        If intAnswer = vbYes Then\r\n            DoCmd.RunCommand acCmdUndo\r\n            DoCmd.OpenForm &quot;sfrClientProfile&quot;, , , , acFormAdd, acDialog\r\n            Response = acDataErrAdded\r\n        Else\r\n            DoCmd.RunCommand acCmdUndo\r\n            Response = acDataErrContinue\r\n        End If\r\n\r\nExit_cboClientID_NotInList:\r\n        Exit Sub\r\n\r\nErr_cboClientID_NotInList:\r\n        MsgBox Err.Description\r\n        Resume Exit_cboClientID_NotInList\r\n\r\nEnd Sub\r\n<\/pre>\n<p><span style=\"color: #b52424;\"><strong>Note<\/strong><\/span>: Copy\/paste everything between the <strong>Private Sub<\/strong> and <strong>End Sub<\/strong> and don&#8217;t forget to change the Form name to match your own.<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_369\" class=\"pvc_stats all  \" data-element-id=\"369\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/access-diva.com\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>There are many examples of how to handle new entries to Combo Boxes, a.k.a. Not_In_List events. However, the one that is not so easily found is how to handle entries that include more than just what&#8217;s in the Combo Box. For example, you&#8217;re entering an Order from a new Client and you need more than [&#8230;]<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_369\" class=\"pvc_stats all  \" data-element-id=\"369\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/access-diva.com\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,37,51],"tags":[17,21,84],"class_list":["post-369","post","type-post","status-publish","format-standard","hentry","category-access-tips","category-combo-boxes","category-method","tag-combo-box","tag-controls","tag-database-design","odd"],"_links":{"self":[{"href":"https:\/\/access-diva.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/access-diva.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/access-diva.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/access-diva.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/access-diva.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=369"}],"version-history":[{"count":2,"href":"https:\/\/access-diva.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/369\/revisions"}],"predecessor-version":[{"id":371,"href":"https:\/\/access-diva.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/369\/revisions\/371"}],"wp:attachment":[{"href":"https:\/\/access-diva.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/access-diva.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/access-diva.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}