{"id":569,"date":"2013-02-15T02:00:33","date_gmt":"2013-02-15T02:00:33","guid":{"rendered":"http:\/\/regina-whipp.com\/blog\/?p=569"},"modified":"2016-07-08T22:44:32","modified_gmt":"2016-07-09T02:44:32","slug":"custom-record-count","status":"publish","type":"post","link":"https:\/\/regina-whipp.com\/blog\/?p=569","title":{"rendered":"Custom Record Count&#8230;"},"content":{"rendered":"<p>There are times you want to display a Record Count on your Form.\u00a0\u00a0Or, maybe,\u00a0you want to use your own <a title=\"Medication\u2026\" href=\"http:\/\/regina-whipp.com\/blog\/?p=538\" target=\"_blank\">Navigation Buttons<\/a> but how to get the Record Count to display?\u00a0 Here are two options&#8230;<\/p>\n<div id=\"attachment_575\" style=\"width: 151px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/www.access-diva.com\/bai1.html\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-575\" class=\"size-full wp-image-575\" src=\"http:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/02\/CardOfCards.png\" alt=\"CardOfCards\" width=\"141\" height=\"27\" \/><\/a><p id=\"caption-attachment-575\" class=\"wp-caption-text\">Click to see entire Form<\/p><\/div>\n<p><strong><br \/>\ntxtPage<\/strong> is the name of the unbound TEXT field between the <a href=\"http:\/\/regina-whipp.com\/blog\/?p=538\" target=\"_blank\">Navigation Buttons<\/a>.\u00a0 <strong><span style=\"color: #0000ff;\">card(s)<\/span><\/strong> is what they are.\u00a0 You can change that to *<strong><span style=\"color: #0000ff;\">ticket(s)<\/span><\/strong>*, *<strong><span style=\"color: #0000ff;\">paper(s)<\/span><\/strong>* or whatever it is you are counting.\u00a0 In the Form&#8217;s On_Current event place&#8230;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Private Sub Form_<strong>Current<\/strong>()<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nOn Error Resume Next\r\n\r\nIf Me.RecordsetClone.RecordCount = 0 Then\r\n   Me.txtPage = &quot;&quot;\r\n   DoCmd.CancelEvent\r\nElse\r\n   With Me.RecordsetClone\r\n     .MoveLast\r\n   Me.txtPage = Me.CurrentRecord &amp; &quot; of &quot; &amp; .RecordCount &amp; &quot; card(s)\r\n   End With\r\nEnd If\r\n<\/pre>\n<p>End Sub<\/p>\n<h4><strong>\u00a0OR<\/strong><\/h4>\n<div id=\"attachment_571\" style=\"width: 231px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/www.access-diva.com\/gtc1.html\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-571\" class=\"size-full wp-image-571\" src=\"http:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/02\/ContractPageOfPages.png\" alt=\"ContractPageOfPages\" width=\"221\" height=\"34\" srcset=\"https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/02\/ContractPageOfPages.png 221w, https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/02\/ContractPageOfPages-150x23.png 150w\" sizes=\"auto, (max-width: 221px) 100vw, 221px\" \/><\/a><p id=\"caption-attachment-571\" class=\"wp-caption-text\">Click to see entire Form<\/p><\/div>\n<p>Create a unbound TEXT box on your form, mine is txtRecordNos, and copy everything after txtRecordNos into the Control Source for the TEXT box (Figure 1)&#8230;<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\ntxtRecordNos = IIf(&#x5B;CurrentRecord]&gt;(Count(*)),'New Record',(\u2018Contract ' &amp; &#x5B;CurrentRecord] &amp; ' of ' &amp; Count(*)))\r\n<\/pre>\n<div id=\"attachment_620\" style=\"width: 739px\" class=\"wp-caption alignleft\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-620\" class=\"wp-image-620 size-full\" src=\"http:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/02\/PropertySheet.png\" alt=\"Figure 1\" width=\"729\" height=\"303\" srcset=\"https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/02\/PropertySheet.png 729w, https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/02\/PropertySheet-300x124.png 300w, https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/02\/PropertySheet-150x62.png 150w, https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/02\/PropertySheet-400x166.png 400w\" sizes=\"auto, (max-width: 729px) 100vw, 729px\" \/><p id=\"caption-attachment-620\" class=\"wp-caption-text\">Figure 1<\/p><\/div>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_569\" class=\"pvc_stats all  \" data-element-id=\"569\" 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>There are times you want to display a Record Count on your Form. Or, maybe, you want to use your own Navigation Buttons but how to get the Record Count to display? Here are two options&#8230;<\/p>\n<p id=\"caption-attachment-575\" class=\"wp-caption-text\">Click to see entire Form<\/p>\n<p> txtPage is the name of the unbound TEXT field between the [&#8230;]<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_569\" class=\"pvc_stats all  \" data-element-id=\"569\" 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":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,63],"tags":[64,31,21],"class_list":["post-569","post","type-post","status-publish","format-standard","hentry","category-access-tips","category-database-design","tag-access-tips","tag-forms","tag-vba","odd"],"_links":{"self":[{"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/569","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=569"}],"version-history":[{"count":25,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/569\/revisions"}],"predecessor-version":[{"id":1273,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/569\/revisions\/1273"}],"wp:attachment":[{"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}