https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/93096&feed=atom&action=history
Microsoft KB Archive/93096 - Revision history
2024-03-28T14:48:39Z
Revision history for this page on the wiki
MediaWiki 1.39.3
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/93096&diff=227015&oldid=prev
3155ffGd: importing KB archive
2020-07-18T17:35:57Z
<p>importing KB archive</p>
<p><b>New page</b></p><div><div id="nsbanner"><br />
<br />
<div id="bannerrow1"><br />
<br />
{|<br />
| Knowledge Base<br />
|<br />
|}<br />
<br />
<br />
</div><br />
<div id="TitleRow"><br />
<br />
= <span id="KB93096"></span>ACC: Using CreateForm() and CreateReport() Functions =<br />
<br />
<br />
</div><br />
<br />
</div><br />
<div id="nstext" valign="BOTTOM"><br />
<br />
Article ID: 93096<br />
<br />
Article Last Modified on 1/18/2007<br />
<br />
<br />
-----<br />
<br />
APPLIES TO<br /><br />
<br /><br />
<br />
* Microsoft Access 1.0 Standard Edition<br />
* Microsoft Access 1.1 Standard Edition<br />
* Microsoft Access 2.0 Standard Edition<br />
* Microsoft Access 95 Standard Edition<br />
* Microsoft Access 97 Standard Edition<br />
<br />
<br />
-----<br />
<br />
<div class="notice_section"><br />
<br />
This article was previously published under Q93096<br />
<br />
</div><br />
<div class="notice_section"><br />
<br />
Moderate: Requires basic macro, coding, and interoperability skills.<br />
<br />
</div><br />
<div class="summary_section"><br />
<br />
== SUMMARY ==<br />
<br />
This article discusses the Microsoft Access functions CreateForm() and CreateReport(). If you intend to write your own Form Wizard or Report Wizard, you can use these functions to create and customize a blank form or report to which you can add controls.<br /><br />
<br /><br />
This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the &quot;Building Applications with Microsoft Access&quot; manual.<br /><br />
<br /><br />
NOTE: Visual Basic for Applications is called Access Basic in Microsoft Access versions 1.x and 2.0. For more information about Access Basic, please refer to the &quot;Introduction to Programming&quot; manual in Microsoft Access version 1.x or the &quot;Building Applications&quot; manual in Microsoft Access version 2.0.<br />
<br />
</div><br />
<div class="moreinformation_section"><br />
<br />
== MORE INFORMATION ==<br />
<br />
The CreateForm() and CreateReport() functions are Visual Basic code equivalents of creating a new form or report in Design view. When you run these functions, they create a new blank form or report in an iconized state.<br /><br />
<br /><br />
Both functions return an object value that you can use for further manipulation, and neither function requires parameters.<br /><br />
<br /><br />
The examples in the paragraphs that follow refer to creating a new form using the CreateForm() function; however, the same information also applies to creating reports with the CreateReport() function.<br /><br />
<br /><br />
To use the CreateForm() function, first define a form object variable, and then assign the variable to the function name. An example of how to do this is:<br />
<pre class="codesample"> Dim MyForm As Form<br />
Set MyForm = CreateForm()<br />
</pre><br />
After the form is created, it is open in Design view and you can set or change its properties, such as the RecordSource property:<br />
<pre class="codesample"> MyForm.RecordSource = &quot;Categories&quot;<br />
</pre><br />
You can also access and change the properties of each of the form's sections using the Section property. The Section property is actually an array with each array value referencing a section on the form. Form sections are stored in the Section property array as follows:<br />
<div class="indent"><br />
<br />
Section(0) - Detail Section<br /><br />
Section(1) - Form Header<br /><br />
Section(2) - Form Footer<br /><br />
Section(3) - Page Header<br /><br />
Section(4) - Page Footer<br />
<br />
<br />
</div><br />
Report sections are stored in the Section property array as follows:<br />
<div class="indent"><br />
<br />
Section(0) - Detail Section<br /><br />
Section(1) - Report Header<br /><br />
Section(2) - Report Footer<br /><br />
Section(3) - Page Header<br /><br />
Section(4) - Page Footer<br /><br />
Section(5) - Group Level 1 Header<br /><br />
Section(6) - Group Level 1 Footer<br /><br />
Section(7) - Group Level 2 Header<br /><br />
and so on<br />
<br />
<br />
</div><br />
With this information, you can customize the design of a form section programmatically. The following example creates a new form and sets the Height and KeepTogether properties of the detail section:<br />
<pre class="codesample"> Dim MyForm As Form<br />
Set MyForm = CreateForm()<br />
MyForm.Section(0).Height = 1760<br />
MyForm.Section(0).KeepTogether = True<br />
</pre><br />
<br />
</div><br />
<div class="references_section"><br />
<br />
== REFERENCES ==<br />
<br />
For more information about the CreateForm() and CreateReport() functions, search the Help Index for <span class="kbd userinput"> CreateForm function</span> or <span class="kbd userinput"> CreateReport function</span>.<br /><br />
<br /><br />
For information about using the CreateControl() and CreateReportControl() functions, please see the following article in the Microsoft Knowledge Base:<br />
<div class="indent"><br />
<br />
[[../93095|93095]] ACC: CreateControl() and CreateReportControl() Functions<br />
<br />
<br />
</div><br />
<br />
</div><br />
<br /><br />
<br />
Additional query words: wizards<br />
<br />
Keywords: kbinfo kbprogramming KB93096<br />
<br />
<div class="footer"><br />
<br />
<br /><br />
<br />
<br />
-----<br />
<br />
[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]<br />
<br />
<span>© Microsoft Corporation. All rights reserved.</span><br />
<br />
<br />
</div><br />
<br />
</div></div>
3155ffGd