{"id":1347,"date":"2019-10-13T21:57:47","date_gmt":"2019-10-13T21:57:47","guid":{"rendered":"https:\/\/portasftpserver.com\/?p=1347"},"modified":"2021-02-04T16:12:14","modified_gmt":"2021-02-05T00:12:14","slug":"ms-access-net-activex","status":"publish","type":"post","link":"https:\/\/portasftpserver.com\/ms-access-net-activex\/","title":{"rendered":"MS Access &#038; .Net ActiveX"},"content":{"rendered":"\n<div class=\"sera-block-image\"><figure class=\"aligncenter is-resized\"><a href=\"https:\/\/portasftpserver.com\/harry\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/05\/me.png\" alt=\"\" class=\"sera-image-799\" width=\"130\" height=\"130\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/05\/me.png 450w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/05\/me-300x300.png 300w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/05\/me-100x100.png 100w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/05\/me-150x150.png 150w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/05\/me-50x50.png 50w\" sizes=\"auto, (max-width: 130px) 100vw, 130px\" \/><\/a><\/figure><\/div>\n\n\n\n<p class=\"has-text-align-center sera-block-paragraph\">In this blog, I am going to show how to make your own <strong><em>ActiveX control<\/em><\/strong> using <strong>.Net Class library<\/strong> in c# and use it in MS Access \ud83d\ude42<\/p>\n\n\n\n<h2 class=\"sera-block-heading\"> What is ActiveX? <\/h2>\n\n\n\n<p class=\"sera-block-paragraph\">ActiveX is a Microsoft-created technology that enables different software applications to share information and functionality. ActiveX only works with Microsoft applications like Word, Excel, Internet  Explorer and PowerPoint, and will only work on a computer running the  Windows operating system. Credit to <a href=\"https:\/\/entertainment.howstuffworks.com\/activex-for-animation1.htm\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">https:\/\/entertainment.howstuffworks.com<\/a><\/p>\n\n\n\n<p class=\"sera-block-paragraph\">In short, ActiveX is a framework created by Microsoft that adapts its earlier Component Object Model (COM) and Object Linking and Embedding (OLE) technologies. ActiveX gives programmers the freedom to create additional libraries or controls that can be shared in different windows applications.<\/p>\n\n\n\n<p class=\"sera-block-paragraph\">Without going into too many details about what ActiveX is let&#8217;s make our own ActiveX in c# and use it in MS Access to make you understand it better.<\/p>\n\n\n\n<h2 class=\"sera-block-heading\">Create the .Net Class Library<\/h2>\n\n\n\n<p class=\"sera-block-paragraph\">In your visual studio, go to create a new project and select <strong>class library<\/strong> in C# or VB I am using VS 2019 but you can use earlier versions of it.<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"532\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-4-1200x532.png\" alt=\"\" class=\"sera-image-1370\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-4-1200x532.png 1200w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-4-600x266.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-4-585x260.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-4-768x341.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-4-100x44.png 100w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-4.png 1206w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">\nName the project to &#8220;ActiveXDotNet&#8221; you can choose whatever you want.\n\n<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"862\" height=\"265\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-5.png\" alt=\"\" class=\"sera-image-1372\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-5.png 862w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-5-600x184.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-5-585x180.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-5-768x236.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-5-100x31.png 100w\" sizes=\"auto, (max-width: 862px) 100vw, 862px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Make sure that you have installed .Net Framework 4+. I am using the .Net Framework 4.7.2.<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"612\" height=\"97\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-6.png\" alt=\"\" class=\"sera-image-1373\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-6.png 612w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-6-600x95.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-6-585x93.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-6-100x16.png 100w\" sizes=\"auto, (max-width: 612px) 100vw, 612px\" \/><\/figure>\n\n\n\n<h2 class=\"sera-block-heading\">Create the Message Box Procedure<\/h2>\n\n\n\n<p class=\"sera-block-paragraph\">Right click the Reference and add\/Ticked the &#8220;System.Windows.Forms&#8221;. This will enable us to make a basic message box.<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"402\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-8-1200x402.png\" alt=\"\" class=\"sera-image-1377\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-8-1200x402.png 1200w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-8-600x201.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-8-585x196.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-8-768x257.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-8-100x34.png 100w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-8.png 1629w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<h2 class=\"sera-block-heading\">Create a User Controls<\/h2>\n\n\n\n<p class=\"sera-block-paragraph\">Right-click the project and go to add-&gt;User Control (Windows forms) and create\/add a User Controls. I will just leave the default name. <\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"959\" height=\"115\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-9.png\" alt=\"\" class=\"sera-image-1379\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-9.png 959w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-9-600x72.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-9-585x70.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-9-768x92.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-9-100x12.png 100w\" sizes=\"auto, (max-width: 959px) 100vw, 959px\" \/><\/figure>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1104\" height=\"481\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-10.png\" alt=\"\" class=\"sera-image-1381\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-10.png 1104w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-10-600x261.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-10-585x255.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-10-768x335.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-10-100x44.png 100w\" sizes=\"auto, (max-width: 1104px) 100vw, 1104px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">In the user control import a button and change the text properties to &#8220;Click Me&#8221; <\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"987\" height=\"428\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-11.png\" alt=\"\" class=\"sera-image-1383\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-11.png 987w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-11-600x260.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-11-585x254.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-11-768x333.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-11-100x43.png 100w\" sizes=\"auto, (max-width: 987px) 100vw, 987px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Double click the button or go to events (with the lightning symbol) and double click the &#8220;click&#8221; button.<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1039\" height=\"359\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-12.png\" alt=\"\" class=\"sera-image-1385\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-12.png 1039w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-12-600x207.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-12-585x202.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-12-768x265.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-12-100x35.png 100w\" sizes=\"auto, (max-width: 1039px) 100vw, 1039px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Put the message box to button event within user control<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"755\" height=\"434\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-13.png\" alt=\"\" class=\"sera-image-1386\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-13.png 755w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-13-600x345.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-13-585x336.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-13-100x57.png 100w\" sizes=\"auto, (max-width: 755px) 100vw, 755px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Right-click the project and go to properties, In Application, click the &#8220;Assembly Information&#8221; and in the pop-up window check\/ticked the &#8220;Make assembly COM-Visible&#8221; and click &#8220;Ok&#8221;. This enables the ActiveX Interface to be visible in Access. <\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"639\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-14-1200x639.png\" alt=\"\" class=\"sera-image-1389\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-14-1200x639.png 1200w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-14-600x319.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-14-585x311.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-14-768x409.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-14-100x53.png 100w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-14.png 1362w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Under build, Check\/Ticked &#8220;Register for COM interop&#8221;<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1184\" height=\"420\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-15.png\" alt=\"\" class=\"sera-image-1392\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-15.png 1184w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-15-600x213.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-15-585x208.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-15-768x272.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-15-100x35.png 100w\" sizes=\"auto, (max-width: 1184px) 100vw, 1184px\" \/><\/figure>\n\n\n\n<h2 class=\"sera-block-heading\">Registering COM<\/h2>\n\n\n\n<p class=\"sera-block-paragraph\">In User Control use System.Runtime.InteropServices, Microsoft.Win32m and System.Reflection. Put the ID and enable the class interface to be accessible.<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1135\" height=\"377\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-17.png\" alt=\"\" class=\"sera-image-1397\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-17.png 1135w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-17-600x199.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-17-585x194.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-17-768x255.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-17-100x33.png 100w\" sizes=\"auto, (max-width: 1135px) 100vw, 1135px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">The <strong>ComRegister Function<\/strong><\/p>\n\n\n\n<figure class=\"sera-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"871\" height=\"579\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2020\/01\/image.png\" alt=\"\" class=\"sera-image-1667\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2020\/01\/image.png 871w, https:\/\/portasftpserver.com\/sera-uploads\/2020\/01\/image-600x399.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2020\/01\/image-585x389.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2020\/01\/image-768x511.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2020\/01\/image-100x66.png 100w\" sizes=\"auto, (max-width: 871px) 100vw, 871px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\"><\/p>\n\n\n\n<p class=\"sera-block-paragraph\">The <strong>ComUnregister Function<\/strong><\/p>\n\n\n\n<figure class=\"sera-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"534\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2020\/01\/image-1.png\" alt=\"\" class=\"sera-image-1668\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2020\/01\/image-1.png 736w, https:\/\/portasftpserver.com\/sera-uploads\/2020\/01\/image-1-600x435.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2020\/01\/image-1-585x424.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2020\/01\/image-1-100x73.png 100w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\"><\/p>\n\n\n\n<p class=\"sera-block-paragraph\">Now save the project and close it completely and open the visual studio as Administrator. <\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"554\" height=\"246\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-20.png\" alt=\"\" class=\"sera-image-1402\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-20.png 554w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-20-100x44.png 100w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">You should be able to see the recent project. If you can&#8217;t see it just simply browse the project from the directory where you save it.<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"516\" height=\"348\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-21.png\" alt=\"\" class=\"sera-image-1403\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-21.png 516w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-21-100x67.png 100w\" sizes=\"auto, (max-width: 516px) 100vw, 516px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Make a new CPU configuration. In my case I am using 64 bit so I would select &#8220;x64&#8221;. You can change the &#8220;Debug&#8221; to &#8220;Release&#8221; but make sure to check the project properties setting that everything are still the same. \ud83d\ude42<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"998\" height=\"357\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-22.png\" alt=\"\" class=\"sera-image-1404\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-22.png 998w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-22-600x215.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-22-585x209.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-22-768x275.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-22-100x36.png 100w\" sizes=\"auto, (max-width: 998px) 100vw, 998px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\"><g class=\"gr_ gr_4 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del\" id=\"4\" data-gr-id=\"4\">Right-Click<\/g> the project and select &#8220;Build&#8221;. <strong>NOTE <\/strong>that you should open <g class=\"gr_ gr_6 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep gr-progress sel\" id=\"6\" data-gr-id=\"6\">V<\/g><g class=\"gr_ gr_17 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace\" id=\"17\" data-gr-id=\"17\">isual<\/g> studio as Administrator, So it can register the library (DLL) to your local registry.<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"764\" height=\"189\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-24.png\" alt=\"\" class=\"sera-image-1408\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-24.png 764w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-24-600x148.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-24-585x145.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-24-100x25.png 100w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-24-760x189.png 760w\" sizes=\"auto, (max-width: 764px) 100vw, 764px\" \/><\/figure>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/yehey-clipart-1200x675.jpg\" alt=\"\" class=\"sera-image-1439\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/yehey-clipart-1200x675.jpg 1200w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/yehey-clipart-600x338.jpg 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/yehey-clipart-585x329.jpg 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/yehey-clipart-768x432.jpg 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/yehey-clipart-100x56.jpg 100w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/yehey-clipart.jpg 1280w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<h2 class=\"sera-block-heading\">Create <em>MS Access Form<\/em><\/h2>\n\n\n\n<p class=\"sera-block-paragraph\">\n Type &#8220;Access&#8221; in windows search and select &#8220;Access&#8221; App \n\n<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"594\" height=\"236\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image.png\" alt=\"\" class=\"sera-image-1359\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image.png 594w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-585x232.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-100x40.png 100w\" sizes=\"auto, (max-width: 594px) 100vw, 594px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Create a blank <g class=\"gr_ gr_4 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del\" id=\"4\" data-gr-id=\"4\">Database<\/g> and name it to &#8220;myMSAccess&#8221; you can choose whatever you want. Select &#8220;Create&#8221; and select &#8220;form design&#8221; and it will get you to new &#8220;Form1&#8221;.<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"974\" height=\"262\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-16.png\" alt=\"\" class=\"sera-image-1395\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-16.png 974w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-16-600x161.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-16-585x157.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-16-768x207.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-16-100x27.png 100w\" sizes=\"auto, (max-width: 974px) 100vw, 974px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\"><\/p>\n\n\n\n<p class=\"sera-block-paragraph\">In &#8220;Design&#8221; import\/select the <strong>button <\/strong>in the <strong>Form1 design<\/strong> and change the <strong>Caption <\/strong>properties to &#8220;Call myMsgBox&#8221;. This button will call the <strong>myMsgBox <\/strong>Function\/Procedure from our customize ActiveX library functionalities.<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"965\" height=\"407\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-7.png\" alt=\"\" class=\"sera-image-1375\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-7.png 965w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-7-600x253.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-7-585x247.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-7-768x324.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-7-100x42.png 100w\" sizes=\"auto, (max-width: 965px) 100vw, 965px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Click the down arrow in the controls <\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"547\" height=\"124\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-26.png\" alt=\"\" class=\"sera-image-1417\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-26.png 547w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-26-100x23.png 100w\" sizes=\"auto, (max-width: 547px) 100vw, 547px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Click ActiveX Control <\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"556\" height=\"326\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-27.png\" alt=\"\" class=\"sera-image-1418\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-27.png 556w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-27-100x59.png 100w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">You can see that &#8220;ActiveXDotNet.UserControl1&#8221; is already registered. Select it and click <strong>ok<\/strong><\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"795\" height=\"163\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-28.png\" alt=\"\" class=\"sera-image-1419\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-28.png 795w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-28-600x123.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-28-585x120.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-28-768x157.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-28-100x21.png 100w\" sizes=\"auto, (max-width: 795px) 100vw, 795px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Now we can see that the controls from .Net Class Library are now accessible in Access. If you click the &#8220;Click Me&#8221; you should be able to see MessageBox.<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"833\" height=\"443\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-31.png\" alt=\"\" class=\"sera-image-1423\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-31.png 833w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-31-600x319.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-31-585x311.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-31-768x408.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-31-100x53.png 100w\" sizes=\"auto, (max-width: 833px) 100vw, 833px\" \/><\/figure>\n\n\n\n<h2 class=\"sera-block-heading\">Accessing the <em>myMsgbox in class1<\/em><\/h2>\n\n\n\n<p class=\"sera-block-paragraph\">Now let&#8217;s call the procedure &#8220;myMsgBox&#8221; from class1 that we created in c# .Net Class library. Click the button &#8220;Call myMsgBox&#8221; set the event to &#8220;[Event Procedure]&#8221; and click the button\/icon with &#8220;&#8230;&#8221; on it.<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"870\" height=\"220\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-32.png\" alt=\"\" class=\"sera-image-1425\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-32.png 870w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-32-600x152.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-32-585x148.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-32-768x194.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-32-100x25.png 100w\" sizes=\"auto, (max-width: 870px) 100vw, 870px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Once you get to the VBA code behind go to <strong>tool-&gt;References<\/strong>. You can see that ActiveXDotNet class is now accessible. Check\/Ticked it and click <strong>ok<\/strong>.<\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1146\" height=\"350\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-33.png\" alt=\"\" class=\"sera-image-1427\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-33.png 1146w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-33-600x183.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-33-585x179.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-33-768x235.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-33-100x31.png 100w\" sizes=\"auto, (max-width: 1146px) 100vw, 1146px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Initiate the class and call the &#8220;myMsgBox&#8221; procedure <\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1183\" height=\"272\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-38.png\" alt=\"\" class=\"sera-image-1443\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-38.png 1183w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-38-600x138.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-38-585x135.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-38-768x177.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-38-100x23.png 100w\" sizes=\"auto, (max-width: 1183px) 100vw, 1183px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Right-click the form and select &#8220;Form View&#8221; <\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"593\" height=\"313\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-35.png\" alt=\"\" class=\"sera-image-1431\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-35.png 593w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-35-585x309.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-35-100x53.png 100w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">Click the button and the message box from &#8220;myMsgBox&#8221; procedure from class1 will appear <\/p>\n\n\n\n<figure class=\"sera-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"362\" src=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-36.png\" alt=\"\" class=\"sera-image-1433\" srcset=\"https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-36.png 780w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-36-600x278.png 600w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-36-585x272.png 585w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-36-768x356.png 768w, https:\/\/portasftpserver.com\/sera-uploads\/2019\/10\/image-36-100x46.png 100w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/figure>\n\n\n\n<p class=\"sera-block-paragraph\">That&#8217;s all \ud83d\ude42 Kindly share this awesome blog \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, I am going to show how to make your own ActiveX control using .Net Class library in c# and use it in MS Access \ud83d\ude42 What is ActiveX? ActiveX is a Microsoft-created technology that enables different software applications to share information and functionality. ActiveX only works with Microsoft applications like Word, Excel, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1351,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[127,129,126],"class_list":["post-1347","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming-software","tag-activex-from-net-with-ms-access","tag-create-your-own-activex-for-ms-office","tag-how-to-make-activex-in-net-for-ms-access"],"_links":{"self":[{"href":"https:\/\/portasftpserver.com\/sera-json\/wp\/v2\/posts\/1347","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/portasftpserver.com\/sera-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/portasftpserver.com\/sera-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/portasftpserver.com\/sera-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/portasftpserver.com\/sera-json\/wp\/v2\/comments?post=1347"}],"version-history":[{"count":0,"href":"https:\/\/portasftpserver.com\/sera-json\/wp\/v2\/posts\/1347\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/portasftpserver.com\/sera-json\/wp\/v2\/media\/1351"}],"wp:attachment":[{"href":"https:\/\/portasftpserver.com\/sera-json\/wp\/v2\/media?parent=1347"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/portasftpserver.com\/sera-json\/wp\/v2\/categories?post=1347"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/portasftpserver.com\/sera-json\/wp\/v2\/tags?post=1347"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}