` Comment on an Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Add a comment to an Icetips Article

Please add your comments to this article. Please note that you must provide both a name and a valid email address in order for us to publish your comment. Comments are moderated and are not visible until they have been approved. Spam is never approved!

Your Name:  
Email:  
Header text/Subject:  

Please enter your comment in the box below:

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Manually controlling autoinc fields
1998-12-23 -- Shawn Simmons
 
1) Create A Local Variable in your form called RECORDADDEDFLAG and set it to a byte. 2) In the Windows init priority 1 method: If GlobalRequest = InsertRecord Set(Ven:PrimaryKey) Previous(Vendors) If Error() Then RecordID# = 1 Else RecordID# = VEN:RecordID+1. Get(Vendors,0);Clear(Ven:Record) Ven:RecordID = RecordID# !Prime any other fields here Access:Vendors.Insert() Relate:Vendors.Fetch(Ven:PrimaryKey) GlobalRequest = ChangeRecord RecordAddedFlag = True End 3) At Windows Kill Method priority 4000: If Self.Response = RequestCancelled AND RecordAddedFlag Then Relate:Vendors.Delete(0). 4) I know this is a brute force way of defining the AUTOINC, but it has NEVER failed me. Make sure that you remove the AUTOINC attribute from the primary key in your access table.


Today is May 2, 2024, 2:36 am
This article has been viewed 35116 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: