https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/100465&feed=atom&action=history
Microsoft KB Archive/100465 - Revision history
2024-03-28T21:40:51Z
Revision history for this page on the wiki
MediaWiki 1.39.3
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/100465&diff=263489&oldid=prev
X010: Text replacement - "<" to "<"
2020-07-20T09:04:26Z
<p>Text replacement - "<" to "<"</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 09:04, 20 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l69">Line 69:</td>
<td colspan="2" class="diff-lineno">Line 69:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Set DS = DB.CreateDynaset(TableQueryName)</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Set DS = DB.CreateDynaset(TableQueryName)</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> DS.MoveFirst</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> DS.MoveFirst</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> If Err <del style="font-weight: bold; text-decoration: none;">&lt;</del>> 0 Then</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> If Err <ins style="font-weight: bold; text-decoration: none;"><</ins>> 0 Then</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> RecordsExist = False</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> RecordsExist = False</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Else</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Else</div></td></tr>
</table>
X010
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/100465&diff=263430&oldid=prev
X010: Text replacement - ">" to ">"
2020-07-20T09:03:04Z
<p>Text replacement - ">" to ">"</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 09:03, 20 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l69">Line 69:</td>
<td colspan="2" class="diff-lineno">Line 69:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Set DS = DB.CreateDynaset(TableQueryName)</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Set DS = DB.CreateDynaset(TableQueryName)</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> DS.MoveFirst</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> DS.MoveFirst</div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> If Err &lt;<del style="font-weight: bold; text-decoration: none;">&gt; </del>0 Then</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> If Err &lt;<ins style="font-weight: bold; text-decoration: none;">> </ins>0 Then</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> RecordsExist = False</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> RecordsExist = False</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Else</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> Else</div></td></tr>
</table>
X010
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/100465&diff=253050&oldid=prev
X010: Text replacement - """ to """
2020-07-19T11:52:45Z
<p>Text replacement - """ to """</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en-GB">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 11:52, 19 July 2020</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l78">Line 78:</td>
<td colspan="2" class="diff-lineno">Line 78:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Given the name of the table or query, this function will return True (-1) if records exist, or False (0) if no records exist.<br /></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Given the name of the table or query, this function will return True (-1) if records exist, or False (0) if no records exist.<br /></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Another method you can use is the DCount() function. However, the DCount() function may be significantly slower than the RecordsExist() function in that it must count all the records in the database whereas RecordsExist simply tests to see if there is a <del style="font-weight: bold; text-decoration: none;">&quot;</del>first<del style="font-weight: bold; text-decoration: none;">&quot; </del>record in the recordset.<br /></div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Another method you can use is the DCount() function. However, the DCount() function may be significantly slower than the RecordsExist() function in that it must count all the records in the database whereas RecordsExist simply tests to see if there is a <ins style="font-weight: bold; text-decoration: none;">"</ins>first<ins style="font-weight: bold; text-decoration: none;">" </ins>record in the recordset.<br /></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><br /></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
</table>
X010
https://www.betaarchive.com/wiki/index.php?title=Microsoft_KB_Archive/100465&diff=45990&oldid=prev
3155ffGd: importing KB archive
2020-07-18T15:01:55Z
<p>importing KB archive</p>
<p><b>New page</b></p><div>{|<br />
|width="100%"|<br />
== ACC1x: Preventing Users from Adding New Records ==<br />
|}<br />
<br />
Q100465<br />
<br />
<br />
-----<br />
<br />
The information in this article applies to:<br /><br />
<br />
<br />
* Microsoft Access versions 1.0, 1.1<br />
<br />
<br />
-----<br />
<br />
<br /><br />
<br />
<br />
== SUMMARY ==<br />
<br />
The DefaultEditing form property, when set to AllowEdits, allows users to both modify existing records and to add new records. Microsoft Access has no built-in mechanism to prevent users from adding new records.<br />
<br />
<br /><br />
<br />
<br />
== MORE INFORMATION ==<br />
<br />
The following example demonstrates a sample, user-defined Access Basic function that you can use to prevent users from entering new employees in the Employees form in the sample database NWIND.MDB:<br /><br />
<br />
<br />
<ol><br />
<li><p>Type the following Access Basic function in a new or existing module:<br /><br />
</p><br />
<pre class="CODESAMP"> Function PreventNew ()<br />
Dim X<br />
On Error Resume Next<br />
X = Screen.ActiveForm.Bookmark<br />
If Err = 3021 Then DoCmd GoToRecord , , A_LAST<br />
End Function<br />
<br />
NOTE: There are two commas between GoToRecord and A_LAST above. </pre></li><br />
<li><p>Change the OnCurrent property of the Employees form to read as follows:<br /><br />
</p><br />
<pre class="FIXEDTEXT"> Form: Employees<br />
----------------------------<br />
OnCurrent: =PreventNew() </pre><br />
<p><br /><br />
Note that the pointer is placed in the last record of the Employees form when you attempt to gain access to or navigate to the new record.</p></li></ol><br />
<br />
=== How PreventNew() Works ===<br />
<br />
Whenever you navigate to a different record, the OnCurrent property runs the PreventNew() function. This function attempts to reference the Bookmark property associated with the current record. All records are assigned a string, called a bookmark, that uniquely identifies each record.<br /><br />
<br /><br />
However, a new record that has not yet been saved has no bookmark associated with it. Any attempt to reference the bookmark of a new record generates an error message. If an error occurs, the PreventNew() function immediately performs a GoToRecord action to navigate to the last record in the form.<br />
<br />
=== Using PreventNew() with Forms That Contain No Records ===<br />
<br />
If the table or query that the form is based on contains no records, PreventNew() does not prevent you from adding a new record to the form. You must first test to see if records exist in the table or query prior to opening the form. You can use the following Access Basic function to test whether records exist in a table or query.<br /><br />
<br />
<br />
<pre class="CODESAMP"> Function RecordsExist (TableQueryName As String)<br />
Dim DB As Database<br />
Dim DS As Dynaset<br />
Set DB = CurrentDB()<br />
On Error Resume Next<br />
Set DS = DB.CreateDynaset(TableQueryName)<br />
DS.MoveFirst<br />
If Err &lt;&gt; 0 Then<br />
RecordsExist = False<br />
Else<br />
RecordsExist = True<br />
End If<br />
End Function </pre><br />
<br /><br />
Given the name of the table or query, this function will return True (-1) if records exist, or False (0) if no records exist.<br /><br />
<br /><br />
Another method you can use is the DCount() function. However, the DCount() function may be significantly slower than the RecordsExist() function in that it must count all the records in the database whereas RecordsExist simply tests to see if there is a &quot;first&quot; record in the recordset.<br /><br />
<br /><br />
<br />
<br />
Keywords : kbprg<br /><br />
Issue type : kbinfo<br /><br />
Technology :<br />
<br />
{|<br />
|width="100%"| <br /><br />
Last Reviewed: November 4, 2000<br /><br />
<span>© 2001 Microsoft Corporation. All rights reserved. Terms of Use.</span><br /><br />
|}</div>
3155ffGd