{"id":2080,"date":"2013-11-11T23:21:37","date_gmt":"2013-11-11T21:21:37","guid":{"rendered":"http:\/\/www.ramses.de\/?p=2080"},"modified":"2013-11-11T23:21:37","modified_gmt":"2013-11-11T21:21:37","slug":"faq-access-fortschrittsbalken-per-vba","status":"publish","type":"post","link":"https:\/\/www.ramses.de\/?p=2080","title":{"rendered":"FAQ Access &#8211; Fortschrittsbalken per VBA"},"content":{"rendered":"<div>\n<h1>Access VBA &#8211; Fortschrittsbalken per VBA<\/h1>\n<\/div>\n<div>\n<h2><strong>Problem <\/strong><\/h2>\n<p>Bei l\u00e4ngeren VBA Proceduren ist nicht erkennbar, wie weit ein Vorgang abgeschlossen ist.<\/p>\n<h2><strong>L\u00f6sung <\/strong><\/h2>\n<p>Wir bauen uns ein Formular mit einem &#8222;Balken&#8220;<\/p>\n<p><a href=\"https:\/\/www.ramses.de\/wp-content\/uploads\/605.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2081\" alt=\"605\" src=\"https:\/\/www.ramses.de\/wp-content\/uploads\/605-300x141.jpg\" width=\"300\" height=\"141\" srcset=\"https:\/\/www.ramses.de\/wp-content\/uploads\/605-300x141.jpg 300w, https:\/\/www.ramses.de\/wp-content\/uploads\/605.jpg 461w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>In einem neuen Modul erstellen wir folgende kleine Routine<\/p>\n<pre><em>Public Function ProgrBar(lngCurr As Long, lngMax As Long, vProzess As String) '***************************************************************** <\/em><i>\r\n <em>'*** Maik Ramftel <\/em>\r\n <em>'*** 2010-06-28<\/em>\r\n <em>'*** Function erstellt einen Fortschritttsbalken<\/em>\r\n <em>'***************************************************************** <\/em>\r\n <em>If DEBUGMODUS = False <\/em>\r\n <em>Then On Error Resume Next <\/em>\r\n <em>End If<\/em>\r\n <em>Dim F As Double, P As Integer <\/em>\r\n <em>If lngCurr = 0 And lngMax = 0 Then <\/em>\r\n <em>'Anzeigen DoCmd.OpenForm \"FOPROGRESSBAR\"<\/em>\r\n <em>[Forms]![FOPROGRESSBAR]!rctStatus.Top = [Forms]![FOPROGRESSBAR]!lblStatus.Top<\/em>\r\n <em>[Forms]![FOPROGRESSBAR]!rctStatus.Left = [Forms]![FOPROGRESSBAR]!lblStatus.Left <\/em>\r\n <em>[Forms]![FOPROGRESSBAR]!rctStatus.Height = [Forms]![FOPROGRESSBAR]!lblStatus.Height<\/em>\r\n <em>[Forms]![FOPROGRESSBAR]!rctStatus.Width = 0 <\/em>\r\n <em>[Forms]![FOPROGRESSBAR]!lblStatus.Caption = \"\"<\/em>\r\n <em>[Forms]![FOPROGRESSBAR]!lblStatus.Visible = True <\/em>\r\n <em>[Forms]![FOPROGRESSBAR]!rctStatus.Visible = True [Forms]![FOPROGRESSBAR]![Prozess].Visible = True<\/em>\r\n <em>[Forms]![FOPROGRESSBAR]![Prozess].Caption = vProzess<\/em>\r\n \r\n <em>ElseIf lngCurr = -1 And lngMax = -1 Then <\/em>\r\n \r\n <em>'Ausblenden [Forms]![FOPROGRESSBAR]!lblStatus.Visible = False <\/em>\r\n <em>[Forms]![FOPROGRESSBAR]!rctStatus.Visible = False <\/em>\r\n <em>DoCmd.Close acForm, \"FOPROGRESSBAR\" <\/em>\r\n \r\n <em>Else <\/em>\r\n \r\n <em>'Aktualisieren <\/em>\r\n <em>F = [Forms]![FOPROGRESSBAR]!lblStatus.Width \/ lngMax <\/em>\r\n <em>[Forms]![FOPROGRESSBAR]!rctStatus.Width = F * lngCurr <\/em>\r\n <em>P = (100 \/ lngMax) * lngCurr <\/em>\r\n <em>[Forms]![FOPROGRESSBAR]![Prozess].Caption = vProzess <\/em>\r\n <em>[Forms]![FOPROGRESSBAR]!lblStatus.Caption = CStr(P) &amp; \"%\" <\/em>\r\n <em>End If <\/em>\r\n <em>DoEvents <\/em>\r\n <em>End Function <\/em><\/i><\/pre>\n<pre>Der Aufruf in der Funktion erfolgt dann<\/pre>\n<pre>Start:<\/pre>\n<pre><em>'****Statusanzeige ****** <\/em><i>\r\n <em>Call ProgrBar(0, 0, vProgressTitel)<\/em><\/i><\/pre>\n<pre>Fortschritt:<\/pre>\n<pre><em>'****Statusanzeige ****** <\/em><i>\r\n <em>Call ProgrBar(vZ\u00e4hlerP, vAnzahlGesamt, vProgressTitel &amp; \" \" &amp; vZ\u00e4hlerP &amp; \"\/\" &amp; vAnzahlGesamt) <\/em><\/i><\/pre>\n<pre>Ende:<\/pre>\n<pre><em>'****Statusanzeige ****** <\/em><i>\r\n <em>Call ProgrBar(-1, -1, vProgressTitel)<\/em><\/i><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Access VBA &#8211; Fortschrittsbalken per VBA Problem Bei l\u00e4ngeren VBA Proceduren ist nicht erkennbar, wie weit ein Vorgang abgeschlossen ist. L\u00f6sung Wir bauen uns ein &#8230; <a title=\"FAQ Access &#8211; Fortschrittsbalken per VBA\" class=\"read-more\" href=\"https:\/\/www.ramses.de\/?p=2080\" aria-label=\"Mehr Informationen \u00fcber FAQ Access &#8211; Fortschrittsbalken per VBA\">Weiterlesen &#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47,43],"tags":[58,61],"class_list":["post-2080","post","type-post","status-publish","format-standard","hentry","category-access","category-faq","tag-access-2010","tag-vba"],"_links":{"self":[{"href":"https:\/\/www.ramses.de\/index.php?rest_route=\/wp\/v2\/posts\/2080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ramses.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ramses.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ramses.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ramses.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2080"}],"version-history":[{"count":1,"href":"https:\/\/www.ramses.de\/index.php?rest_route=\/wp\/v2\/posts\/2080\/revisions"}],"predecessor-version":[{"id":2082,"href":"https:\/\/www.ramses.de\/index.php?rest_route=\/wp\/v2\/posts\/2080\/revisions\/2082"}],"wp:attachment":[{"href":"https:\/\/www.ramses.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ramses.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ramses.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}