Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: BobAlston Newsgroups: comp.databases.ms-access Subject: Using AllenBrowne's AppAudit routine - getting errors with nulls Date: Sun, 01 May 2011 18:40:29 -0500 Organization: A noiseless patient Spider Lines: 34 Message-ID: Reply-To: bobalston9@yahoo.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 1 May 2011 23:40:21 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="XXxibxL5//o6plrDR5oatw"; logging-data="28593"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Xuzqd480HybyvQAzazQq8yxIWoGvOR5g=" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10 Cancel-Lock: sha1:ExDCno4N7UWzjAu3pRQKIS+wuyE= Xref: x330-a1.tempe.blueboxinc.net comp.databases.ms-access:1149 Anyone else use Allen Browne's appAudit routine to log changes to Access tables? allenbrowne.com/appaudit.html I set it up for one table. When writing the before image of the table record, I get the error "you tried to assign the null value to a variable that is not a variant data type" It occurs in db.Execute sSQL and sSQL is INSERT INTO aud_client_Data_Additional SELECT TOP 1 audtmp_client_Data_Additional.* from audtemp.client_data_additional where (audtemp_client_Data_Additional.audtype = 'EditFrom') ORDER BY audtemp_Client_Data_Additional.audDate DESC; It is writing the before image of the record, previously saved in the audtemp.... table into the aud.... table. Clearly my table DOES have various null values in it. It seems to me that my best approach to resolve would be to use DAO or ADO and update the data fields using a loop of all controls and check for null values before attempting to set a value. Anyone have other suggestions? Bob