{"id":1052,"date":"2015-12-19T19:14:25","date_gmt":"2015-12-20T00:14:25","guid":{"rendered":"http:\/\/regina-whipp.com\/blog\/?p=1052"},"modified":"2016-01-01T19:29:29","modified_gmt":"2016-01-02T00:29:29","slug":"controlling-scrollbars-in-subforms","status":"publish","type":"post","link":"https:\/\/regina-whipp.com\/blog\/?p=1052","title":{"rendered":"Controlling Scrollbars in Subforms&#8230;"},"content":{"rendered":"<p>Subforms are a little peculiar when used as Continuous Forms\u2026 when the Subform produces 3 records which, in this example, calls for the Scrollbar and you then switch, from the Main Form, and you only have two records or less showing you have this shadow area where the Scrollbar used to be (Figure2)\u2026 slightly annoying and not very nice looking on your Form.<\/p>\n<p><span style=\"color: #000000; font-family: Segoe UI; font-size: small;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2015\/12\/ScrollBars.png\" alt=\"\" width=\"140\" height=\"99\" \/><\/span><\/p>\n<p>To avoid this put the below in the On_Current event of the Subform\u2026<\/p>\n<p><em>Note: In this example the Subform is sized to allow three records to show.\u00a0 If you have adjusted to show more (or less) records then adjust the RecordCount accordingly.<\/em><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nIf Me.RecordsetClone.RecordCount &gt;\u00a01 Then\r\n   Me.ScrollBars = 2\r\nElse\r\n   Me.ScrollBars = 0\r\nEnd If\r\n<\/pre>\n<p><strong>Form.ScrollBars Property<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"0\"><strong>Setting<\/strong><\/td>\n<td width=\"0\"><strong>Visual Basic<\/strong><\/td>\n<td width=\"0\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Neither (forms) None (text boxes)<\/td>\n<td>0<\/td>\n<td>(Default for text boxes) No scroll bars appear on the form or text box.<\/td>\n<\/tr>\n<tr>\n<td>Horizontal Only (forms)<\/td>\n<td>1<\/td>\n<td>Horizontal scroll bar appears on the form. Not applicable to text boxes.<\/td>\n<\/tr>\n<tr>\n<td>Vertical Only (forms) Vertical (text boxes)<\/td>\n<td>2<\/td>\n<td>Vertical scroll bar appears on the form or text box.<\/td>\n<\/tr>\n<tr>\n<td>Both (forms)<\/td>\n<td>3<\/td>\n<td>(Default for forms) Vertical and horizontal scroll bars appear on the form. Not applicable to text boxes.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>From: <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/office\/ff834790.aspx?f=255&amp;MSPPError=-2147217396\">https:\/\/msdn.microsoft.com\/en-us\/library\/office\/ff834790.aspx?f=255&amp;MSPPError=-2147217396<\/a><\/p>\n<p><em>(Though the page says Office 2013 or later this property has been available since Access 97, so, feel free to use in earlier versions of Access.)<\/em><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_1052\" class=\"pvc_stats all  \" data-element-id=\"1052\" 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:\/\/regina-whipp.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>Subforms are a little peculiar when used as Continuous Forms\u2026 when the Subform produces 3 records which, in this example, calls for the Scrollbar and you then switch, from the Main Form, and you only have two records or less showing you have this shadow area where the Scrollbar used to be (Figure2)\u2026 slightly annoying [&#8230;]<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_1052\" class=\"pvc_stats all  \" data-element-id=\"1052\" 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:\/\/regina-whipp.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],"tags":[64,41,18,72],"class_list":["post-1052","post","type-post","status-publish","format-standard","hentry","category-access-tips","tag-access-tips","tag-continuous-forms","tag-database-design","tag-scrollbars","odd"],"a3_pvc":{"activated":true,"total_views":1336,"today_views":0},"_links":{"self":[{"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1052"}],"version-history":[{"count":7,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1052\/revisions"}],"predecessor-version":[{"id":1175,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1052\/revisions\/1175"}],"wp:attachment":[{"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}