UrbanPro

Learn Microsoft Excel Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

How do I write HTML code to export form data into MS Access or Excel?

Asked by Last Modified  

Follow 2
Answer

Please enter your answer

yes, you can In your HTML form firstly you need to create a separate table In the create id tags and thereafter you use a JavaScript to replace the inner HTML with the value of the fields on your form from where it collects the data you want. please check below mention example, <!DOCTYPE...
read more

yes, you can

In your HTML form firstly you need to create a separate table 

In the create id tags and thereafter you use a JavaScript to replace the inner HTML with the value of the fields on your form from where it collects the data you want. 

please check below mention example,

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script type="text/javascript">
  5. function fillHidTable1(){
  6. var htqf1; //-- hidden field
  7. var rf1; //-- retrieved field
  8. for ( var i = 1; i < 5; i++ ) {
  9. rf1 = "htqf"+i;
  10. document.getElementById(rf1).innerHTML = document.getElementById("Q1"+i+"CALC1").value;
  11. }
  12. tableToExcel('hidTable1', 'Analysis Results1');
  13. }
  14.  
  15. var tableToExcel1 = (function() {
  16. var uri = 'data:application/vnd.ms-excel;base64,'
  17. , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'
  18. , base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
  19. , format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
  20. return function(table, name) {
  21. if (!table.nodeType) table = document.getElementById(table)
  22. var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}
  23. window.location.href = uri + base64(format(template, ctx))
  24. }
  25. })()
  26. </script>
  27.  
  28. <title>HTML Form Data to Excel</title>
  29.  
  30. <style type="text/css" media="screen">
  31. .divCenMid{font-family:Arial,sans-serif;font-size:14pt;font-style:normal;font-weight:700;text-align:center;vertical-align:middle;margin:0;}
  32. .allbdrCenMid{border:.75pt solid windowtext;color:#000;font-family:Arial,sans-serif;font-size:10pt;font-style:normal;font-weight:400;text-align:center;vertical-align:middle;margin:0;}
  33. .allbdrCenTop{border:.75pt solid windowtext;color:#000;font-family:Arial,sans-serif;font-size:10pt;font-style:normal;font-weight:400;text-align:center;vertical-align:top;margin:0;}
  34. .allbdrLtMid{border:.75pt solid windowtext;color:#000;font-family:Arial,sans-serif;font-size:10pt;font-style:normal;font-weight:400;text-align:left;vertical-align:middle;margin:0;}
  35. .allbdrLtTop{border:.75pt solid windowtext;color:#000;font-family:Arial,sans-serif;font-size:10pt;font-style:normal;font-weight:400;text-align:left;vertical-align:top;margin:0;}
  36.  
  37. </style>
  38.  
  39. </head>
  40.  
  41. <body>
  42.  
  43. <table width= "565px" cellspacing="0" cellpadding="0" style="border-spacing:0;" id="QMSTable">
  44. <col width="25px"/>
  45. <col width="120px"/>
  46. <col width="360px"/>
  47. <col width="60px"/>
  48. <tr>
  49. <td class="divCenMid1" colspan = "4"> QMS Assessment</td>
  50. </tr>
  51. <tr>
  52. <td class="allbdrCenMid1"> No</td>
  53. <td class="allbdrCenMid1"> Criteria</td>
  54. <td class="allbdrLtMid1"> Question</td>
  55. <td class="allbdrCenMid1"> Score</td>
  56. </tr>
  57. <tr>
  58. <td class="allbdrCenTop"> Q1</td>
  59. <td class="allbdrLtTop"> Quality Unit Independency</td>
  60. <td class="allbdrLtTop"> Do you have the Quality Unit?</td>
  61. <td class="allbdrCenMid">
  62. <input id="Q1CALC" type="text" value="" class="nobdrCenMid" style="overflow:hidden; width:93% " name="Q1CALC"/>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td class="allbdrCenTop"> Q2</td>
  67. <td class="allbdrLtTop"> Apply PICS GMP</td>
  68. <td class="allbdrLtTop"> Which GMP regulation do you use?</td>
  69. <td class="allbdrCenMid">
  70. <input id="Q2CALC" type="text" value="" class="nobdrCenMid" style="overflow:hidden; width:93% " name="Q2CALC"/>
  71. </td>
  72. </tr>
  73. <tr>
  74. <td class="allbdrCenTop"> Q3</td>
  75. <td class="allbdrLtTop"> Deviation or Non-conformance</td>
  76. <td class="allbdrLtTop"> Do you have a deviation or non-conformance procedure?</td>
  77. <td class="allbdrCenMid">
  78. <input id="Q3CALC" type="text" value="" class="nobdrCenMid" style="overflow:hidden; width:93% " name="Q3CALC"/>
  79. </td>
  80. </tr>
  81. <tr>
  82. <td class="allbdrCenTop"> Q4</td>
  83. <td class="allbdrLtTop"> Complaint</td>
  84. <td class="allbdrLtTop"> Do you have a customer complaint procedure?</td>
  85. <td class="allbdrCenMid">
  86. <input id="Q4CALC" type="text" value="" class="nobdrCenMid" style="overflow:hidden; width:93% " name="Q4CALC"/>
  87. </td>
  88. </tr>
  89. </table>
  90.  
  91. <div id="hidTable" style="display: none">
  92. <table id="testTable">
  93. <caption>Supplier Risk Analysis</caption>
  94. <colgroup></colgroup>
  95. <colgroup></colgroup>
  96. <colgroup></colgroup>
  97. <thead>
  98. <tr>
  99. <th>No.</th>
  100. <th>Question</th>
  101. <th>Score</th>
  102. </tr>
  103. </thead>
  104. <tbody>
  105. <tr>
  106. <td>Q1</td>
  107. <td>Do you have the Quality Unit?</td>
  108. <td id="htqf1">-</td>
  109. </tr>
  110. <tr>
  111. <td>Q2</td>
  112. <td>Apply PICS GMP?</td>
  113. <td id="htqf2">-</td>
  114. </tr>
  115. <tr>
  116. <td>Q3</td>
  117. <td>Do you have a deviation or non-conformance procedure?</td>
  118. <td id="htqf3">-</td>
  119. </tr>
  120. <tr>
  121. <td>Q4</td>
  122. <td>Do you have a customer complaint procedure?</td>
  123. <td id="htqf4">-</td>
  124. </tr>
  125. </tbody>
  126. </table>
  127. </div>
  128.  
  129. <input type="button" onclick="fillHidTable()" value="Export Data to Excel">
  130. </body>
  131. </html>
 
 
 
read less
Comments

Adobe Certified , Microsoft Certified Trainer with 9 years of experience

If you mean an actual form in datasheet view, you can export that form's data to Excel with the DoCmd.OutputTo method. DoCmd.OutputTo acOutputForm, "frmResults", acFormatXLS, _ "C:\SomeFolder\ExportedResults.xls" However, if you're opening a query in datasheet view, rather than an actual form,...
read more

If you mean an actual form in datasheet view, you can export that form's data to Excel with the DoCmd.OutputTo method.

DoCmd.OutputTo acOutputForm, "frmResults", acFormatXLS, _
    "C:\SomeFolder\ExportedResults.xls"

However, if you're opening a query in datasheet view, rather than an actual form, you can export the query's result set.

DoCmd.OutputTo acOutputQuery, "qryResults", acFormatXLS, _
    "C:\SomeFolder\ExportedResults.xls"

You can choose a different OutputFormat instead of Excel if you wish. Look at Access' Help topic for the OutputTo method to see the available choices.

read less
Comments

Related Questions

Use of INDEX in MS Excel?

INDEX function is a powerful tool that allows you to retrieve values from a specified range or array based on row and column numbers. INDEX(array, row_num, ) As it requires row_num and column_num, it is...
Prabhakar
0 0
6
Is it necessary to have the knowledge of VB script for Excel Macro Training?
Please make a correction, its not VB Script but Excel VBA that you need to learn. VB Script is different form Excel VBA even though they both are subset of VB (the same parent), Please google to know more....
Suma Kv
Is there any free software to convert a word file to PDF?
When you go to print comment in place of Printer, you will get print to PDF or Microsoft print to PDF. IF you click on this, the word document gets converted in PDF.Also, you can go to File and Save and...
Gaurang
0 0
7
Which course can be related to MIS executives, Since I have past experience in data base related job I want to try for MIS profile. So kindly suggest me which course suits me for the same profile.
Hi, You can check our course - Analyse and Visualize with Excel. Excel is the most popular tools used by analyst and MIS manager for getting insights from data. Create powerful Dashboards to enable data driven decision making.
Martin

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Data Analysis with MS Excel Filter - Top Performers, Bottom Performers, Above Average Performers, Below Average Performers!
In the following, You would find lesser-known, unexplored yet Powerful Features of Filter. Please refer to sample dataset below: To do Data Analysis:Step 1) Apply Filter on the dataset.Step 2) In Sales...

Basic excel required for MIS position
Dear Students, Today we will know about the mis and its importance in business world. In Business world, organisation's have many business problem related to process are exists. For taking any decision,...

Some Excel Functions
You need to know about these following functions which are based on Microsoft Excel 2010.1. Speedily Move and Copy Data in Cells:-If you want to move one column of data in a spreadsheet, the fast way...
I

ICreative Solution

0 0
0

VBA Function -
Using FORMAT Function in VBA we can modify the format of Numbers, Dates, Times & String. Syntax: FORMAT(expression, format, , ) 1. Formatting "Numbers" using FORMAT function in VBA SUB Format_Numbers() MsgBox...

Dget-Extract From A Database A Single Record That Matches The Condition We Specify
Syntax: DGET(Database, Field, Criteria) The DGET function syntax has the following arguments: Database Required: The range of cells that makes up the list or database. A database is a list of related...
D

Daniel I

1 0
0

Recommended Articles

Microsoft Office is a very popular tool amongst students and C-Suite. Today, approximately 1.2 billion people across 140 countries use the office programme. It is used at home, schools and offices on a daily basis for organizing, handling and presenting data and information. Microsoft Office Suite offers programs that can...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Looking for Microsoft Excel Training classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Microsoft Excel Training Classes?

The best tutors for Microsoft Excel Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Microsoft Excel Training with the Best Tutors

The best Tutors for Microsoft Excel Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more