{"id":753,"date":"2013-08-09T17:58:37","date_gmt":"2013-08-09T17:58:37","guid":{"rendered":"http:\/\/regina-whipp.com\/blog\/?p=753"},"modified":"2016-07-08T22:51:35","modified_gmt":"2016-07-09T02:51:35","slug":"logo","status":"publish","type":"post","link":"https:\/\/regina-whipp.com\/blog\/?p=753","title":{"rendered":"Add Logo to Forms and\/or Reports&#8230;"},"content":{"rendered":"<p>You can allow Client&#8217;s to insert their own logo on the Switchboard or Main Menu (and, if you like Reports).\u00a0\u00a0This is especially a nice touch as Clients will be able to personalize the file as\u00a0their own.<\/p>\n<p>The <span style=\"color: #cc0000;\"><strong>first <\/strong><\/span>thing you will need is a separate table the holds the Company Profile information, Figure 1.\u00a0 (<strong>Note<\/strong>: I do not store the image in the database but do allow Users to navigate to the image storing only the path to the image.<\/p>\n<div id=\"attachment_757\" style=\"width: 608px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-757\" class=\"wp-image-757 size-full\" src=\"http:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/08\/tblCompanyProfile.png\" alt=\"Figure 1\" width=\"598\" height=\"637\" srcset=\"https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/08\/tblCompanyProfile.png 598w, https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/08\/tblCompanyProfile-281x300.png 281w, https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/08\/tblCompanyProfile-140x150.png 140w, https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/08\/tblCompanyProfile-400x426.png 400w\" sizes=\"auto, (max-width: 598px) 100vw, 598px\" \/><p id=\"caption-attachment-757\" class=\"wp-caption-text\">Figure 1<\/p><\/div>\n<p><strong><span style=\"color: #cc0000;\">Second<\/span><\/strong>, is a to place an <strong>Image Control<\/strong> on the form\u00a0and\/or reports and set *<strong>Picture to (NONE)<\/strong>* and\u00a0*<strong>Size Mode to Zoom<\/strong>*, Figure 2.\u00a0 (For the purpose of this example, my <strong>Image Control<\/strong> is named <strong>imgLogo<\/strong>.)<\/p>\n<div id=\"attachment_758\" style=\"width: 614px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-758\" class=\"wp-image-758 size-full\" src=\"http:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/08\/frmCompanyProfile.png\" alt=\"Figure 2\" width=\"604\" height=\"383\" srcset=\"https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/08\/frmCompanyProfile.png 604w, https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/08\/frmCompanyProfile-300x190.png 300w, https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/08\/frmCompanyProfile-150x95.png 150w, https:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/08\/frmCompanyProfile-400x253.png 400w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><p id=\"caption-attachment-758\" class=\"wp-caption-text\">Figure 2<\/p><\/div>\n<p><strong><span style=\"color: #cc0000;\">Third<\/span><\/strong>, add a Command Button to your form to *get the Image*.\u00a0 Mine has a little camera on it and is named <strong>cmdAddImage<\/strong>.\u00a0\u00a0Then place <strong>Call GetImage<\/strong> in the On_Click event&#8230;<\/p>\n<p>Private Sub <strong>cmdAddImage<\/strong>_Click()<br \/>\n<strong>Call GetImage<\/strong><br \/>\nEnd Sub<\/p>\n<p><strong>GetImage<\/strong> code from my <strong>modUtilities<\/strong>&#8230;<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nPublic Sub GetImage()\r\n\u00a0\u00a0\u00a0 Dim fDialog\u00a0\u00a0\u00a0 As Object\r\n\u00a0\u00a0\u00a0 Dim varFile As Variant\r\n\u00a0\u00a0\u00a0\r\n\u00a0\u00a0 ' Set up the File Dialog.\r\n\u00a0\u00a0\u00a0 Set fDialog = Application.FileDialog(3)\r\n\u00a0\r\n\u00a0\u00a0\u00a0 With fDialog\r\n\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 ' Allow user to make multiple selections in dialog box\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 .AllowMultiSelect = False\r\n\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 ' Set the title of the dialog box. '\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 .Title = &quot;Please select file to add...&quot;\r\n\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 ' Clear out the current filters, and add our own.\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 .Filters.Clear\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 .Filters.Add &quot;Compressed Image Files&quot;, &quot;*.jpg, *.gif, *.png&quot;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 .Filters.Add &quot;Uncompressed Image Files&quot;, &quot;*.bmp, *.wmf&quot;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 .Filters.Add &quot;All Files&quot;, &quot;*.*&quot;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 .InitialFileName = &quot;C:\\&quot;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 ' Show the dialog box. If the .Show method returns True, the\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 ' user picked at least one file. If the .Show method returns\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 ' False, the user clicked Cancel.\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 If .Show = True Then\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 varFile = .SelectedItems.Item(1)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Forms!&#x5B;frmInputCompanyProfile]!&#x5B;txtImagePath] = Mid(varFile, InStrRev(varFile, &quot;\\&quot;) + 1)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 Else\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 MsgBox &quot;You clicked Cancel in the file dialog box.&quot;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 End If\r\n\u00a0\u00a0 End With\r\n\r\nEnd Sub\r\n<\/pre>\n<p><strong><span style=\"color: #cc0000;\">Fourth<\/span><\/strong>, add a Command Button to your form to *remove the Image*.\u00a0 Mine has a little\u00a0circle with a line thru it and is named <strong>cmdClearImage<\/strong>.\u00a0\u00a0Then place\u00a0the below in the On_Click event&#8230;<\/p>\n<p>Private Sub cmdClearImage_Click()<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nOn Error Resume Next 'Lazy mans error handling\r\n\r\n\u00a0\u00a0\u00a0 Me.txtImagePath = Null\r\n\u00a0\u00a0\u00a0 Me.imgImage.Picture = &quot;&quot;\r\n<\/pre>\n<p>End Sub<\/p>\n<p><strong><span style=\"color: #cc0000;\">Fifth<\/span><\/strong>, add the below to the frmCompanyProfile&#8217;s <strong>On_Open <\/strong>event&#8230;<\/p>\n<p>Private Sub Form_Current()<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nOn Error Resume Next\u00a0\u00a0'Lazy mans error handling\r\n\r\n     If IsNull(&#x5B;txtImagePath]) Then Exit Sub\r\n     Me.imgImage.Picture = Me.txtImagePath\r\n<\/pre>\n<p>End Sub<\/p>\n<p><strong><span style=\"color: #cc0000;\">Sixth<\/span><\/strong>, add an <strong>Image Control<\/strong>, naming it <strong>imgLogo<\/strong> to all the Forms and\/or Reports you want your Logo to be displayed on.<\/p>\n<p><strong><span style=\"color: #cc0000;\">And<\/span> <span style=\"color: #cc0000;\">finally<\/span><\/strong>, place the code below in the <strong>On_Open<\/strong> event of your Forms and\/or Reports to get the logo to show, as shown in Figure 3&#8230;<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n\u00a0\u00a0\u00a0 If IsNull(DLookup(&quot;&#x5B;cpImagePath]&quot;, &quot;tblCompanyProfile&quot;)) Then Exit Sub\r\n\u00a0\u00a0\u00a0 Me.imgLogo.Picture = DLookup(&quot;&#x5B;cpImagePath]&quot;, &quot;tblCompanyProfile&quot;)\r\n<\/pre>\n<div id=\"attachment_761\" style=\"width: 456px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-761\" class=\"wp-image-761 size-full\" src=\"http:\/\/regina-whipp.com\/blog\/wp-content\/uploads\/2013\/08\/MainMenu.gif\" alt=\"Figure 3\" width=\"446\" height=\"440\" \/><p id=\"caption-attachment-761\" class=\"wp-caption-text\"><strong>Figure 3<\/strong><\/p><\/div>\n<p><strong><span style=\"color: #cc0000;\">P.S.<\/span><\/strong> Another example using a different format can be found at my website, <a href=\"http:\/\/www.access-diva.com\/f3.html\" target=\"_blank\">Customize your Main Menu (Switchboard)<\/a>.<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_753\" class=\"pvc_stats all  \" data-element-id=\"753\" 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>You can allow Client&#8217;s to insert their own logo on the Switchboard or Main Menu (and, if you like Reports). This is especially a nice touch as Clients will be able to personalize the file as their own.<\/p>\n<p>The first thing you will need is a separate table the holds the Company Profile information, Figure [&#8230;]<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_753\" class=\"pvc_stats all  \" data-element-id=\"753\" 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,63],"tags":[64,42,31,30],"class_list":["post-753","post","type-post","status-publish","format-standard","hentry","category-access-tips","category-database-design","tag-access-tips","tag-add-logo","tag-forms","tag-reports","odd"],"_links":{"self":[{"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/753","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=753"}],"version-history":[{"count":17,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/753\/revisions"}],"predecessor-version":[{"id":1280,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/753\/revisions\/1280"}],"wp:attachment":[{"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regina-whipp.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}